Skip to content

Commit

Permalink
Merge pull request #53 from yookoala/fix-http-host-header
Browse files Browse the repository at this point in the history
fix: session mapping http_host
  • Loading branch information
yookoala authored Sep 23, 2020
2 parents 1a6b857 + 6c4ba66 commit 022cc62
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@ func MapHeader(inner SessionHandler) SessionHandler {
return func(client Client, req *Request) (*ResponsePipe, error) {
r := req.Raw

// Explicitly map raw host field because golang core library seems to remove
// the header field.
if r.Host != "" {
req.Params["HTTP_HOST"] = r.Host
}

// http header
for k, v := range r.Header {
formattedKey := strings.Replace(strings.ToUpper(k), "-", "_", -1)
Expand Down

0 comments on commit 022cc62

Please sign in to comment.