Improve error message on invalid request start-line

Open
#81 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
backend

Research direction

No file or test is named in the issue. Start by locating the request start-line parsing path and the existing "invalid HTTP version" error, then inspect nearby tests. Done means that requests beginning with whitespace produce a more helpful error while existing valid start-lines retain their behavior.

Written by the indexing model from the issue text.

Description

If the HTTP message begins with whitespace, the resulting error is "invalid HTTP version". This felt misleading, or at least less helpful than it could be, since the version (HTTP/1.1) in the start-line was fine. If the message could instead either, ideally call out leading whitespace (as it may be subtle to spot), or at least instead say something like "invalid start-line", or "doesn't match HTTP format", or similar, I think it could help save people some time in tracking down this particular issue.

Dominant language
Rust
Stars
713
Forks
134
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

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.

More from seanmonstar/httparse

All issues in seanmonstar/httparse

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.