Added more tests

This commit is contained in:
2024-03-27 20:41:27 +01:00
parent 98e1a47328
commit b6c208c75b
7 changed files with 211 additions and 144 deletions

View File

@ -12,10 +12,10 @@ type Response interface {
io.Writer
io.StringWriter
Body() []byte
Header(key string) string
Header(string) string
SetHeader(key string, value string)
SetBody([]byte)
SetStatus(status int)
SetStatus(int)
Status() int
}
@ -44,9 +44,9 @@ func (res *response) Header(key string) string {
// SetHeader sets the header value for the given key.
func (res *response) SetHeader(key string, value string) {
for _, header := range res.headers {
for i, header := range res.headers {
if header.Key == key {
header.Value = value
res.headers[i].Value = value
return
}
}