Created
November 23, 2019 20:37
-
-
Save Sytten/e339da21f3912d69b867bdf65ab3946e to your computer and use it in GitHub Desktop.
Snipped from Gunicorn
This file contains 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
curr = lines.pop(0) | |
header_length = len(curr) | |
if curr.find(":") < 0: | |
raise InvalidHeader(curr.strip()) | |
name, value = curr.split(":", 1) | |
name = name.rstrip(" \t").upper() | |
if HEADER_RE.search(name): | |
raise InvalidHeaderName(name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment