mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
35510746b7
Add allowOriginChange option to ResolveUrlOptions in resolveUrl to enforce same-origin validation on resolved URLs. When set to false, it prevents any cross-origin changes (including HTTP/HTTPS URLs), aligning the emulated server-side platform location environment with browser security behavior. Refactor ServerPlatformLocation.replaceState to use allowOriginChange: false instead of manual comparison, hardening state change validation against cross-origin URLs. Add unit tests in url_spec.ts and platform_location_spec.ts for the origin validation changes.