Added more tests

This commit is contained in:
Eduard Urbach 2024-03-27 20:41:27 +01:00
parent c2dc387569
commit 78a628abbe
Signed by: eduard
GPG key ID: 49226B848C78F6C8
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
}
}