pydantic / pydantic/httpx2

httpx.exceptions.RemoteProtocolError: malformed data

Open
#505 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.5k
Forks
76
Avg merge
8h 59m
Merged PRs (30d)
24

Description

Originally opened by @shimachao on 2020-10-15 12:12:16 in encode/httpx

Checklist
  • The bug is reproducible against the latest release and/or master.
  • There are no similar issues or pull requests to fix it yet.
Describe the bug

When server returns bad headers,RemoteProtocolError occurred

To reproduce

headers = {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,"
"image/avif,image/webp,image/apng,/;q=0.8,application/"
"signed-exchange;v=b3;q=0.9",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "zh-CN,zh;q=0.9",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/"
"86.0.4240.75 Safari/537.36"}
client= httpx.AsyncClient(headers=headers, timeout=120,verify=False, proxies=proxies)
await client.get("https://club.huawei.com/forum.html")

Expected behavior
Actual behavior
Debugging material
Environment
  • OS:
  • Python version: 3.8.5
  • HTTPX version: 0.16.1
  • Async environment: asyncio
  • HTTP proxy: no
  • Custom certificates: no
Additional context

bad header:
get-ban-to-cache-result/forum.php: userdata not support

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing the asyncio request to https://club.huawei.com/forum.html with the supplied headers and environment, then inspect the full traceback and HTTP response parsing path. The issue does not state the expected handling of the malformed header or define a completion test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.