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

LibRequests+LibWeb+RequestServer: Add and assign optional reason phrase #1876

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rmg-x
Copy link
Contributor

@rmg-x rmg-x commented Oct 20, 2024

Fixes 54 test cases across the following WPT tests :^)

auto const second_space_offset = space_positions.at(1);
auto const reason_phrase_string_view = header_line.substring_view(second_space_offset + 1).trim_whitespace();
if (!reason_phrase_string_view.is_empty())
request->reason_phrase = MUST(String::from_utf8(reason_phrase_string_view));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it guaranteed this is valid UTF-8?

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 this pull request may close these issues.

2 participants