Improved performance
This commit is contained in:
parent
892dce8979
commit
354d22caba
2 changed files with 10 additions and 16 deletions
15
Response.go
15
Response.go
|
@ -2,7 +2,6 @@ package web
|
|||
|
||||
import (
|
||||
"io"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Response is the interface for an HTTP response.
|
||||
|
@ -78,17 +77,3 @@ func (res *response) WriteString(body string) (int, error) {
|
|||
res.body = append(res.body, body...)
|
||||
return len(body), nil
|
||||
}
|
||||
|
||||
// headerText combines all HTTP headers into a single string.
|
||||
func (res *response) headerText() string {
|
||||
combined := strings.Builder{}
|
||||
|
||||
for _, header := range res.headers {
|
||||
combined.WriteString(header.Key)
|
||||
combined.WriteString(": ")
|
||||
combined.WriteString(header.Value)
|
||||
combined.WriteString("\r\n")
|
||||
}
|
||||
|
||||
return combined.String()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue