Skip to content

Commit 58dc648

Browse files
yohanbonifaceyouknowone
authored andcommitted
Fix header fragmentation parsing
1 parent af31207 commit 58dc648

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

httptools/parser/parser.pyx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ cdef class HttpParser:
9595
self._last_error = None
9696

9797
cdef _maybe_call_on_header(self):
98-
if self._current_header_name is not None:
98+
if self._current_header_value is not None:
9999
current_header_name = self._current_header_name
100100
current_header_value = self._current_header_value
101101

@@ -107,7 +107,10 @@ cdef class HttpParser:
107107

108108
cdef _on_header_field(self, bytes field):
109109
self._maybe_call_on_header()
110-
self._current_header_name = field
110+
if self._current_header_name is None:
111+
self._current_header_name = field
112+
else:
113+
self._current_header_name += field
111114

112115
cdef _on_header_value(self, bytes val):
113116
if self._current_header_value is None:

0 commit comments

Comments
 (0)