Skip to content
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.

Commit

Permalink
Update RFC 7230 syntax rules per errata ID: 4667
Browse files Browse the repository at this point in the history
  • Loading branch information
vfaronov committed Oct 10, 2016
1 parent 441e983 commit 71290f5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
6 changes: 4 additions & 2 deletions httpolice/syntax/rfc7230.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ def transfer_coding(no_trailers=False, no_q=False):
chunk_size = (lambda s: int(s, 16)) << string1(HEXDIG) > pivot
chunk_ext_name = token > auto
chunk_ext_val = token | quoted_string > auto
chunk_ext = many(skip(';') * chunk_ext_name *
maybe(skip('=') * chunk_ext_val)) > pivot

# As updated by RFC 7230 errata ID: 4667.
chunk_ext = many(skip(BWS * ';' * BWS) * chunk_ext_name *
maybe(skip(BWS * '=' * BWS) * chunk_ext_val)) > pivot

Host = uri_host + maybe_str(':' + port) > pivot

Expand Down
26 changes: 26 additions & 0 deletions test/combined_data/1015_2
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
1015

# RFC 7230 errata ID: 4667.

======== BEGIN INBOUND STREAM ========
POST / HTTP/1.1
Host: example.com
Content-Type: text/plain
User-Agent: demo
Transfer-Encoding: chunked
Trailer: some-result

1c
foo bar foo bar foo bar baz
5; ext1 = value1; ext2 = "value2 value3"
xyzzy
0
Some-Result: okay

======== BEGIN OUTBOUND STREAM ========
HTTP/1.1 200 OK
Date: Thu, 31 Dec 2015 18:26:56 GMT
Content-Type: text/plain
Content-Length: 14

Hello world!

0 comments on commit 71290f5

Please sign in to comment.