Skip to content

Answer 400 to a request target that is not visible ASCII - #1951

Merged
uNetworkingAB merged 1 commit into
uNetworking:masterfrom
nigrosimone:ascii-request-target
Oct 2, 2026
Merged

uNetworkingAB merged 1 commit into
uNetworking:masterfrom
nigrosimone:ascii-request-target

Conversation

@nigrosimone

Copy link
Copy Markdown
Contributor

Raw UTF-8 in the request target gets 200 (Http11Probe MAL-NON-ASCII-URL and MAL-URL-OVERLONG-UTF8). RFC 9112 3.2 builds the target from URI characters, so visible ASCII only. Node.js answers 400 to both.

The fix makes the word scan in consumeRequestLine stop also on a byte over 126, and the byte loop fail on it. It costs 4 instructions every 8 bytes of target.

The new test sends three targets, one long enough that only the word scan sees the UTF-8. It fails without the fix.

With Http11Probe locally only these two tests move, from Fail to Pass.

@nigrosimone
nigrosimone marked this pull request as ready for review October 2, 2026 06:08
@uNetworkingAB
uNetworkingAB merged commit e706f16 into uNetworking:master Oct 2, 2026
@uNetworkingAB

Copy link
Copy Markdown
Contributor

I get 157/159 with all your recent PRs

@nigrosimone
nigrosimone deleted the ascii-request-target branch October 3, 2026 03:05
@nigrosimone

nigrosimone commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor Author

I get 157/159 with all your recent PRs

157/159 isn't cool, 159/159 is cool

image

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