Skip to content

perf(request): fast-path QUERY methods#376

Open
usualoma wants to merge 1 commit into
mainfrom
perf/query-method-fast-path
Open

perf(request): fast-path QUERY methods#376
usualoma wants to merge 1 commit into
mainfrom
perf/query-method-fast-path

Conversation

@usualoma

Copy link
Copy Markdown
Member

Note

This is a very small optimization. It does not change behavior in any way.

Add QUERY to the fast path in normalizeIncomingMethod.

Node.js http.createServer() already supports receiving QUERY requests and exposing the method through req.method. Support was introduced in Node.js v22.2.0 via nodejs/node#52701 and later backported to Node.js v20.19.3.

This change avoids an unnecessary toUpperCase() call and makes the standardized method explicitly recognized by the normalization fast path.

QUERY is added only to the exact-uppercase fast path. Lowercase and mixed-case variants remain unchanged because HTTP method names are case-sensitive.

@usualoma

Copy link
Copy Markdown
Member Author

Hi @yusukebe,
Could you please leave a review?

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.

1 participant