Added request headers

This commit is contained in:
2024-03-27 22:12:16 +01:00
parent b6c208c75b
commit c3bb8336a3
6 changed files with 131 additions and 65 deletions

View File

@ -3,8 +3,6 @@ package web
import (
"io"
"strings"
"git.akyoto.dev/go/router"
)
// Response is the interface for an HTTP response.
@ -22,8 +20,8 @@ type Response interface {
// response represents the HTTP response used in the given context.
type response struct {
body []byte
headers []header
status uint16
headers []router.Parameter
}
// Body returns the response body.
@ -51,7 +49,7 @@ func (res *response) SetHeader(key string, value string) {
}
}
res.headers = append(res.headers, router.Parameter{Key: key, Value: value})
res.headers = append(res.headers, header{Key: key, Value: value})
}
// SetBody replaces the response body with the new contents.