Repository navigation
validate host characters - #3113
Merged
Merged
Conversation
Member
Author
|
cherry picked to stable d3d3df5 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Request.host,get_host, andhost_is_trustedvalidate the characters of the host value. They do not validate the value, only that its characters could form a valid host. The empty string is no longer allowed, the host value must contain characters.The
trusted_listargument tohost_is_trustedis optional to make it easier to use to validate the characters only, if trusted hosts aren't configured.If no
Hostheader is present, these would fall back to using the server's configured address(host, port). When listening on a unix socket, this would end up like("/path/to/socket", None), which is not valid as a host value. A unix socket address is now ignored, as it would not produce a useful value when used by other functions such as URL building anyway.Rewrite the docs for these.