-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass on headers from original request. #37
Conversation
@@ -99,7 +99,9 @@ func (tcs *CacheStrategy) HashWithParameters(method string, url string, requestH | |||
} | |||
} | |||
|
|||
return hex.EncodeToString(hasher.Sum(nil)) | |||
hash := hex.EncodeToString(hasher.Sum(nil)) | |||
// logging.Logger.Error("HASH = " + hash + ", url = " + url + ", host = " + requestHeader.Get("Host")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove ..
// Jira 3946: go deletes the "Host" header from the request (for whatever reasons): | ||
// https://golang.org/src/net/http/request.go: | ||
// 123 // For incoming requests, the Host header is promoted to the | ||
// 124 // Request.Host field and removed from the Header map. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't understand the number 123, 124
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's just the copy&pasted line numbers from request.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, understand now.
… incompatibilities.
The Host header, which is automatically deleted by go, is restored and, together with the other headers from the original request, is passed on to the FetchDefinitions.
That way we can make caching decisions based on the host, for services that handle more than one host, with same paths but different content.