Skip to content

RemoteProtocolError: Illegal header line in response #130

Open
@yshen-ya

Description

@yshen-ya

The server I was trying to reach return every response with this line in header which raise RemoteProtocolError. I tried to forge a response with the header line, showing it is valid. Is there any way I can get the response pass with h11 header validator?
image

Traceback (most recent call last):
  File "C:\Users\yshen\AppData\Local\pypoetry\Cache\virtualenvs\magic-WQZay8yd-py3.9\lib\site-packages\httpx\_client.py", line 1502, in _send_single_request
    (status_code, headers, stream, ext,) = await transport.arequest(
  File "C:\Users\yshen\AppData\Local\pypoetry\Cache\virtualenvs\magic-WQZay8yd-py3.9\lib\site-packages\httpcore\_async\connection_pool.py", line 218, in arequest
    response = await connection.arequest(
  File "C:\Users\yshen\AppData\Local\pypoetry\Cache\virtualenvs\magic-WQZay8yd-py3.9\lib\site-packages\httpcore\_async\connection.py", line 106, in arequest
    return await self.connection.arequest(method, url, headers, stream, ext)
  File "C:\Users\yshen\AppData\Local\pypoetry\Cache\virtualenvs\magic-WQZay8yd-py3.9\lib\site-packages\httpcore\_async\http11.py", line 72, in arequest
    ) = await self._receive_response(timeout)
  File "C:\Users\yshen\AppData\Local\pypoetry\Cache\virtualenvs\magic-WQZay8yd-py3.9\lib\site-packages\httpcore\_async\http11.py", line 133, in _receive_response
    event = await self._receive_event(timeout)
  File "C:\Users\yshen\AppData\Local\pypoetry\Cache\virtualenvs\magic-WQZay8yd-py3.9\lib\site-packages\httpcore\_async\http11.py", line 169, in _receive_event
    event = self.h11_state.next_event()
  File "c:\users\yshen\scoop\apps\python\3.9.0\lib\contextlib.py", line 135, in __exit__
    self.gen.throw(type, value, traceback)
  File "C:\Users\yshen\AppData\Local\pypoetry\Cache\virtualenvs\magic-WQZay8yd-py3.9\lib\site-packages\httpcore\_exceptions.py", line 12, in map_exceptions
    raise to_exc(exc) from None
httpcore.RemoteProtocolError: illegal header line: bytearray(b"Content-Security-Policy : default-src \'self\';script-src https: \'unsafe-eval\' \'unsafe-inline\'; style-src https: \'unsafe-inline\';img-src * \'self\' data: https")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions