Skip to content

refactor(helpers): remove Internet Explorer detection from isURLSameOrigin - #11174

Merged
jasonsaayman merged 3 commits into
axios:v1.xfrom
wittachai-as:remove-msie-check
Oct 13, 2026
Merged

jasonsaayman merged 3 commits into
axios:v1.xfrom
wittachai-as:remove-msie-check

Conversation

@wittachai-as

@wittachai-as wittachai-as commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Remove obsolete Internet Explorer user-agent detection from browser same-origin checks. Native URL.host already includes non-default ports, so the existing host comparison rejects cross-port URLs even with an MSIE/Trident user-agent string. This removes redundant compatibility logic without changing origin decisions in supported environments.

Linked issue

No separate issue. The rationale is removing the leftover user-agent branch after the native URL migration in #6714; current browser support excludes Internet Explorer.

Changes

  • Remove the msie|trident sniff and always compare protocol, host, and port.
  • Resolve the conflict with current v1.x, preserving document.baseURI || platform.origin from fix: align request handling across runtimes (v1.x) #11242 and its existing cross-origin document-base/XSRF tests.
  • Add native-URL unit coverage for modern and MSIE/Trident user agents, missing navigator, default HTTP/HTTPS ports, hostname normalization, cross-port/protocol/host boundaries, userinfo, and the non-browser fallback.
  • Add browser coverage for relative URLs and port/protocol differences, plus a public Axios XHR regression assertion that a different port does not receive the XSRF header.
  • Add the required Maintenance entry to PRE_RELEASE_CHANGELOG.md.

Validation

Local validation used Node 26.8.1, npm 11.19.0, and Vitest 4.1.11 on macOS.

  • npm ci --ignore-scripts: passed; package manifest and lockfile unchanged.
  • npx playwright install: passed.
  • npx prettier --check lib/helpers/isURLSameOrigin.js tests/unit/helpers/isURLSameOrigin.test.js tests/browser/isURLSameOrigin.browser.test.js tests/browser/xsrf.browser.test.js PRE_RELEASE_CHANGELOG.md: passed.
  • npm run lint: passed.
  • npm run build: passed for all configured bundles.
  • npm run test:vitest:unit -- tests/unit/helpers/isURLSameOrigin.test.js: 7 passed.
  • npm run test:vitest:unit: 1,611 passed across 70 files.
  • npm run test:vitest:browser:headless: 876 passed, 3 existing skips, across 75 browser/file combinations in Chromium, Firefox, and WebKit. This includes the existing document-base protection and explicit withXSRFToken cases.
  • git diff --check: passed.
  • These are characterization tests for a behavior-preserving refactor; no newly fixed native-URL port bypass is claimed.
  • Separate local CJS/ESM declaration and packed-package suites are not required: no public types, exports, packaging, or build configuration changed. GitHub CI still runs its full package/runtime matrix.

GitHub Actions for head b6c3e537: fork-run approval was granted for all four workflows. Workflow security analysis, build reproducibility, and bundle size passed; Continuous integration is still running. Track Continuous integration, build reproducibility, bundle size, and workflow security analysis. The old head's failed runs and passing review/security bot checks are not build/test evidence for this update.

Compatibility and documentation

Patch impact. No supported-environment behavior change, new configuration, public API, or type change. Cross-origin XSRF attachment still requires explicit withXSRFToken: true; the current document-base handling remains intact. No changes to index.d.ts/index.d.cts, README, or migration guidance are needed. There is no deferred public documentation work to record in PRE_RELEASE_DOCS.md; the internal cleanup is recorded in PRE_RELEASE_CHANGELOG.md.

Checklist

  • Scope, target branch, and linked issue/rationale checked
  • PRE_RELEASE_CHANGELOG.md entry added or updated
  • Regression tests and relevant negative/platform cases covered
  • Applicable local checks completed, with actual commands and results recorded above
  • Deferred release docs and ESM/CJS types/tests updated where needed (not needed; rationale above)
  • Semver impact stated and intentional breaking changes explained (none)
  • Final diff reviewed for security, unrelated changes, generated artifacts, and test/debug leftovers
  • Latest GitHub Actions status recorded separately from review/security bot results (Continuous integration pending; other workflows passed; links above)

@greptile-apps

greptile-apps Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] Safe to merge based on the reviewed changes; no blocking issues were identified.

Summary

Removes Internet Explorer user-agent detection from isURLSameOrigin without changing origin decisions in supported browsers.

  • Browser origin checks use the same port rules for every user agent.

No actionable issues found. No tests were run during this review.

Reviews (2) · Last reviewed commit: "Merge branch 'v1.x' into remove-msie-che..." · Reviewed by Greptile

@jasonsaayman jasonsaayman added commit::fix The PR is related to a bugfix v1x Version 1 labels Sep 1, 2026
@jasonsaayman jasonsaayman added the ai-assisted This PR was created with or in conjunction with AI label Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted This PR was created with or in conjunction with AI commit::fix The PR is related to a bugfix v1x Version 1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants