Skip to content

Commit

Permalink
👔 up(net/httpheader): update the ResponseToString() and add new sub p…
Browse files Browse the repository at this point in the history
…kg httpheader
  • Loading branch information
inhere committed Apr 20, 2023
1 parent bec4ab9 commit 4de6408
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 12 additions & 0 deletions netutil/httpheader/header.go
@@ -0,0 +1,12 @@
package httpheader

Check warning on line 1 in netutil/httpheader/header.go

View workflow job for this annotation

GitHub Actions / Test on go 1.19 and ubuntu-latest

should have a package comment

Check warning on line 1 in netutil/httpheader/header.go

View workflow job for this annotation

GitHub Actions / Test on go 1.20 and ubuntu-latest

should have a package comment

Check warning on line 1 in netutil/httpheader/header.go

View workflow job for this annotation

GitHub Actions / Test on go 1.18 and ubuntu-latest

should have a package comment

const (
UserAgent = "User-Agent"

Check warning on line 4 in netutil/httpheader/header.go

View workflow job for this annotation

GitHub Actions / Test on go 1.19 and ubuntu-latest

exported const UserAgent should have comment (or a comment on this block) or be unexported

Check warning on line 4 in netutil/httpheader/header.go

View workflow job for this annotation

GitHub Actions / Test on go 1.20 and ubuntu-latest

exported const UserAgent should have comment (or a comment on this block) or be unexported
UserAuth = "Authorization"

Accept = "Accept"
Cookie = "Cookie"

AcceptEnc = "Accept-Encoding"
ContentType = "Content-Type"
)
1 change: 0 additions & 1 deletion netutil/httpreq/util.go
Expand Up @@ -255,7 +255,6 @@ func ResponseToString(w *http.Response) string {
buf.WriteByte('\n')

if len(w.Header) > 0 {
buf.WriteByte('\n')
for key, values := range w.Header {
buf.WriteString(key)
buf.WriteString(": ")
Expand Down

0 comments on commit 4de6408

Please sign in to comment.