Skip to content

Commit

Permalink
chore(martian): rename writeHeadResponse() to writeHeaderOnlyResponse()
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatczuk committed Nov 21, 2024
1 parent 8ff5807 commit 9fa9113
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/martian/head.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"golang.org/x/exp/maps"
)

// writeHeadResponse writes the status line and header of r to w.
func writeHeadResponse(w io.Writer, res *http.Response) error {
// writeHeaderOnlyResponse writes the status line and header of r to w.
func writeHeaderOnlyResponse(w io.Writer, res *http.Response) error {
// Status line
text := res.Status
if text == "" {
Expand Down
2 changes: 1 addition & 1 deletion internal/martian/proxy_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ func (p *proxyConn) writeResponse(res *http.Response) error {
// The http package is misbehaving when writing a HEAD response.
// See https://github.com/golang/go/issues/62015 for details.
// This works around the issue by writing the response manually.
err = writeHeadResponse(p.brw.Writer, res)
err = writeHeaderOnlyResponse(p.brw.Writer, res)
default:
// Add support for Server Sent Events - relay HTTP chunks and flush after each chunk.
// This is safe for events that are smaller than the buffer io.Copy uses (32KB).
Expand Down

0 comments on commit 9fa9113

Please sign in to comment.