Skip to content

Commit 26ec787

Browse files
brataopgjones
authored andcommitted
Fix issue #133 by allowing additional whitespace in chunk headers
This is to be lenient to servers that return whitespace. Note, the standard, RFC7230 section 3.3.1 doesn't allow allow this whitepsace.
1 parent 15ec7da commit 26ec787

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

h11/_abnf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,8 @@
125125
chunk_header = (
126126
r"(?P<chunk_size>{chunk_size})"
127127
r"(?P<chunk_ext>{chunk_ext})?"
128-
r"\r\n".format(**globals())
128+
r"{OWS}\r\n".format(
129+
**globals()
130+
) # Even though the specification does not allow for extra whitespaces,
131+
# we are lenient with trailing whitespaces because some servers on the wild use it.
129132
)

0 commit comments

Comments
 (0)