Last active
October 30, 2018 17:59
-
-
Save njsmith/2bd3e54649379ecadf8a699c7bb8bcb3 to your computer and use it in GitHub Desktop.
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
import h11 | |
def write_headers_titlecase(headers, write): | |
for name, value in headers: | |
if name == b"host": | |
write(b"%s: %s\r\n" % (name.title(), value)) | |
for name, value in headers: | |
if name != b"host": | |
write(b"%s: %s\r\n" % (name.title(), value)) | |
write(b"\r\n") | |
h11._writers.write_headers = write_headers_titlecase |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks @njsmith
Turns out it needed this, after all: