Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

h2.exceptions.ProtocolError: Received duplicate pseudo-header field :path #346

@xianglisegue

Description

@xianglisegue

The following test code:

from hyper import HTTP20Connection
conn = HTTP20Connection('google.com:80')
conn.request('GET', '/restconf/data/ietf-yang-library:modules-state/module=ietf-netconf-acm,2012-02-22')
resp = conn.get_response()
print(resp.read())

generates

Traceback (most recent call last):
  File "ht.py", line 4, in <module>
    conn.request('GET', '/restconf/data/ietf-yang-library:modules-state/module=ietf-netconf-acm,2012-02-22')
  File "C:\Python27_segue\lib\site-packages\hyper\http20\connection.py", line 271, in request
    self.endheaders(message_body=body, final=True, stream_id=stream_id)
  File "C:\Python27_segue\lib\site-packages\hyper\http20\connection.py", line 555, in endheaders
    stream.send_headers(headers_only)
  File "C:\Python27_segue\lib\site-packages\hyper\http20\stream.py", line 98, in send_headers
    conn.send_headers(self.stream_id, headers, end_stream)
  File "C:\Python27_segue\lib\site-packages\h2\connection.py", line 844, in send_headers
    headers, self.encoder, end_stream
  File "C:\Python27_segue\lib\site-packages\h2\stream.py", line 913, in send_headers
    headers, encoder, hf, hdr_validation_flags
  File "C:\Python27_segue\lib\site-packages\h2\stream.py", line 1307, in _build_headers_frames
    encoded_headers = encoder.encode(headers)
  File "C:\Python27_segue\lib\site-packages\hpack\hpack.py", line 249, in encode
    for header in headers:
  File "C:\Python27_segue\lib\site-packages\h2\utilities.py", line 473, in inner
    for header in headers:
  File "C:\Python27_segue\lib\site-packages\h2\utilities.py", line 418, in _validate_host_authority_header
    for header in headers:
  File "C:\Python27_segue\lib\site-packages\h2\utilities.py", line 330, in _reject_pseudo_header_fields
    "Received duplicate pseudo-header field %s" % header[0]
h2.exceptions.ProtocolError: Received duplicate pseudo-header field :path

I think the URL '/restconf/data/ietf-yang-library:modules-state/module=ietf-netconf-acm,2012-02-22'
should be valid. It appears that he comma between "ietf-netconf-acm,2012-02-22" is causing problems.

Any ideas how do I overcome this?
Thanks!
-Xiang

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions