Open
Conversation
0a93a5e to
3093ab4
Compare
Member
|
ref: https://golang.org/pkg/net/http/#Request |
Member
// Constants for readRequest's deleteHostHeader parameter.
const (
deleteHostHeader = true
keepHostHeader = false
)and in // RFC 7230, section 5.3: Must treat
// GET /index.html HTTP/1.1
// Host: www.google.com
// and
// GET http://www.google.com/index.html HTTP/1.1
// Host: doesntmatter
// the same. In the second case, any Host line is ignored.
req.Host = req.URL.Host
if req.Host == "" {
req.Host = req.Header.get("Host")
}
if deleteHostHeader {
delete(req.Header, "Host")
} |
Member
|
ref: request.go 218 // For server requests Host specifies the host on which the URL
219 // is sought. Per RFC 7230, section 5.4, this is either the value
220 // of the "Host" header or the host name given in the URL itself.
221 // It may be of the form "host:port". For international domain
222 // names, Host may be in Punycode or Unicode form. Use
223 // golang.org/x/net/idna to convert it to either format if
224 // needed.
225 // To prevent DNS rebinding attacks, server Handlers should
226 // validate that the Host header has a value for which the
227 // Handler considers itself authoritative. The included
228 // ServeMux supports patterns registered to particular host
229 // names and thus protects its registered Handlers.
230 //
231 // For client requests Host optionally overrides the Host
232 // header to send. If empty, the Request.Write method uses
233 // the value of URL.Host. Host may contain an international
234 // domain name.
235 Host stringI think you should use |
Author
|
ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin Our target is to determine whether the request is same origin. So I think just determine whether the |
Member
|
@liaojianqi please fix the conflicts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.