http-rs / http-rs/surf

"invalid header value" error on some websites

Open
#288 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.5k
Forks
128
PR merge metrics
No merged PRs in 30d

Description

On some websites, e.g. http://ceip.org, surf fails with the following error:

> invalid header value

Firefox, curl and ureq (a blocking Rust client) work fine.

3888 websites out of the top million from [Feb 3 Tranco list](https://tranco-list.eu/list/3G6L) are affected.

Tested using [this code](https://github.com/Shnatsel/rust-http-clients-smoke-test/blob/f206362f2e81521bbefb84007cdd25242f6db590/surf-smoke-test/src/main.rs). Test tool output from all affected websites: [surf-invalid-header-value.tar.gz](https://github.com/http-rs/surf/files/6054930/surf-invalid-header-value.tar.gz)

I've only tested the async-h1 backend; I don't know if the other backends are affected.

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

Start with the linked surf-smoke-test code and the async-h1 backend, then reproduce the "invalid header value" error against the affected websites or the supplied output archive. Compare the behavior with Firefox, curl, and ureq; done means the affected sites no longer fail with this error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.