Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging of HTTP field names or values that contain illegal bytes #413

Open
LPardue opened this issue Mar 17, 2024 · 0 comments · May be fixed by #414
Open

Logging of HTTP field names or values that contain illegal bytes #413

LPardue opened this issue Mar 17, 2024 · 0 comments · May be fixed by #414
Assignees

Comments

@LPardue
Copy link
Member

LPardue commented Mar 17, 2024

While normally HTTP header names and values are expected to be safe strings (possibly with even further restrictions on the chartacter set that is allowed), it's possible that an endpoint could receive garbage bytes that it would validate and reject. In such scenarios, it can be useful to log what was received for the purposes of debugging root causes.

The H3HeadersFrame uses the H3HTTPField type, where names and values use the text type. This is unfortunate as it forces implementers into certain approaches to logging. For instance, Rust has a f[rom_utf8_lossy()](https://doc.rust-lang.org/std/string/struct.String.html#method.from_utf8_lossy) method that would insert a � for an invalid sequence. While safe, this discards information that could be useful to understand excatly what was received.

@LPardue LPardue self-assigned this Mar 17, 2024
LPardue added a commit that referenced this issue Mar 17, 2024
@LPardue LPardue linked a pull request Mar 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant