Skip to content

Commit f5bb80f

Browse files
Record why received trailers are not marked with trailer! in a SECURITY: comment. (#68)
1 parent 342e0de commit f5bb80f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎lib/protocol/http1/body/chunked.rb‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ def read_trailer
154154
break if line.empty?
155155

156156
if match = line.match(HEADER)
157+
# SECURITY: Trailers join the headers unmarked. This is not a smuggling vector: `trailer: true` admits only fields whose policy permits trailers, and position does not change what those fields mean.
157158
@headers.add(match[1], match[2], trailer: true)
158159
else
159160
raise BadHeader, "Could not parse header: #{line.inspect}"

0 commit comments

Comments
 (0)