Skip to content

fix(fetch): correct 'navigator' typo to 'navigate' in fetchFinale#5044

Merged
KhafraDev merged 1 commit intonodejs:mainfrom
deepview-autofix:deepview/75319bcf0b
Apr 16, 2026
Merged

fix(fetch): correct 'navigator' typo to 'navigate' in fetchFinale#5044
KhafraDev merged 1 commit intonodejs:mainfrom
deepview-autofix:deepview/75319bcf0b

Conversation

@deepview-autofix
Copy link
Copy Markdown
Contributor

The condition in step 7 of fetchFinale checked fetchParams.request.mode !== 'navigator', but 'navigator' is not a valid request mode — the spec value is 'navigate'. Because the typo never matched, the guarded block always ran, setting responseStatus and extracting the MIME type even for navigate-mode responses with cross-origin redirects, which the spec requires to be skipped.

The condition in step 7 of fetchFinale checked
`fetchParams.request.mode !== 'navigator'`, but 'navigator' is not a
valid request mode — the spec value is 'navigate'. Because the typo
never matched, the guarded block always ran, setting responseStatus
and extracting the MIME type even for navigate-mode responses with
cross-origin redirects, which the spec requires to be skipped.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: DeepView Autofix <276251120+deepview-autofix@users.noreply.github.com>
Co-Authored-By: Nikita Skovoroda <chalkerx@gmail.com>
Signed-off-by: Nikita Skovoroda <chalkerx@gmail.com>
Copy link
Copy Markdown
Member

@KhafraDev KhafraDev left a comment

Choose a reason for hiding this comment

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

looks correct, is it possible to add a test?

@ChALkeR
Copy link
Copy Markdown
Member

ChALkeR commented Apr 16, 2026

@KhafraDev The autofix status said this:

Fixed the 'navigator''navigate' typo at lib/web/fetch/index.js:1028. Verified fetch still works via smoke test. Skipped adding a new test since navigate mode cannot be set from user code (throws TypeError) — any test would be useless. Patch written to ~/fix.patch.

Copy link
Copy Markdown
Member

@KhafraDev KhafraDev left a comment

Choose a reason for hiding this comment

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

"navigate"
This is a special mode used only when navigating between documents.

it is correct

@KhafraDev KhafraDev merged commit a6f8644 into nodejs:main Apr 16, 2026
34 checks passed
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.03%. Comparing base (bc0a19c) to head (d67962d).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/web/fetch/index.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5044      +/-   ##
==========================================
- Coverage   93.03%   93.03%   -0.01%     
==========================================
  Files         110      110              
  Lines       35793    35793              
==========================================
- Hits        33301    33299       -2     
- Misses       2492     2494       +2     

☔ View full report in Codecov by Sentry.
📢 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.

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.

4 participants