Skip to content

fix: add missing spaces and tabs to HTTP tspecials validation#5425

Closed
shivarm wants to merge 1 commit into
nodejs:mainfrom
shivarm:fix-typo
Closed

fix: add missing spaces and tabs to HTTP tspecials validation#5425
shivarm wants to merge 1 commit into
nodejs:mainfrom
shivarm:fix-typo

Conversation

@shivarm

@shivarm shivarm commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Correct the isTSpecial function to fully comply with the RFC 2616 specification by including space (0x20) and horizontal tab (0x09). Also fixed an incorrect comment tracking the = character.

@codecov-commenter

codecov-commenter commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.35%. Comparing base (363e44f) to head (9a8e91b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5425   +/-   ##
=======================================
  Coverage   93.35%   93.35%           
=======================================
  Files         110      110           
  Lines       36993    36995    +2     
=======================================
+ Hits        34535    34537    +2     
  Misses       2458     2458           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@KhafraDev

Copy link
Copy Markdown
Member

Please rebase and add a test

@KhafraDev KhafraDev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The comments above isTSpecial and isToken do not match the implementation.


     token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,
                 or tspecials>

     tspecials :=  "(" / ")" / "<" / ">" / "@" /
                   "," / ";" / ":" / "\" / <">
                   "/" / "[" / "]" / "?" / "="
                   ; Must be in quoted-string,
                   ; to use within parameter values

> Correct the isTSpecial function to fully comply with the RFC 2616
> specification by including space (0x20) and horizontal tab (0x09).
> Also include test and fixed an incorrect comment tracking the '=' character

Signed-off-by: Shivam Sharma <meshivam81@gmail.com>
@KhafraDev

Copy link
Copy Markdown
Member

I meant that tspecial and token is defined in RFC 2045 https://datatracker.ietf.org/doc/html/rfc2045

@KhafraDev

Copy link
Copy Markdown
Member

RFC 2616 makes no mention of tspecials and is obsolete. Please don't use an ai to think for you, verify whatever it comes up with next time.

@KhafraDev KhafraDev closed this Jun 14, 2026
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.

3 participants