Title: fix(upgrade): account for baseHref when calling navigateByUrl by zbuhler · Pull Request #20467 · angular/angular · GitHub
Open Graph Title: fix(upgrade): account for baseHref when calling navigateByUrl by zbuhler · Pull Request #20467 · angular/angular
X Title: fix(upgrade): account for baseHref when calling navigateByUrl by zbuhler · Pull Request #20467 · angular/angular
Description: url.pathname needs to remove baseHref otherwise it repeatedly gets added causing numerous redirects Fixes #20061 PR Checklist Please check if your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit Tests for the changes have been added (for bug fixes / features) Docs have been added / updated (for bug fixes / features) PR Type What kind of change does this PR introduce? [x] Bugfix [ ] Feature [ ] Code style update (formatting, local variables) [ ] Refactoring (no functional changes, no api changes) [ ] Build related changes [ ] CI related changes [ ] Documentation content changes [ ] angular.io application / infrastructure changes [ ] Other... Please describe: What is the current behavior? Currently the baseHref is not being removed when syncing the URL from AngularJS to Angular. Issue Number: 20061 What is the new behavior? The baseHref is now removed before calling navigateByUrl which fixes navigation problems / seemingly infinite redirects. Does this PR introduce a breaking change? [ ] Yes [x] No Other information I know there is a commit against this issue already but I feel this is a more robust way to address the issue. This change, rather than parsing and splicing url fragments and inferring the baseHref, uses LocationStrategy's getBaseHref() and simply removes it before navigating. Seems less fragile AND more importantly will also work in the case where somebody manually sets APP_BASE_HREF. Another item of note is there was no spec file covering this method. I attempted to add one but get odd results when trying to call setupLocationSync from within my test. When calling setupLocationSync from within a test my assertion would not be reached whereas without the call to setupLocationSync it does. Perhaps this is why there is no test? In any case, I am willing to add one but might need some guidance.
Open Graph Description: url.pathname needs to remove baseHref otherwise it repeatedly gets added causing numerous redirects Fixes #20061 PR Checklist Please check if your PR fulfills the following requirements: The comm...
X Description: url.pathname needs to remove baseHref otherwise it repeatedly gets added causing numerous redirects Fixes #20061 PR Checklist Please check if your PR fulfills the following requirements: The comm...
Opengraph URL: https://github.com/angular/angular/pull/20467
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:31c5b367-cf75-711b-ceed-681d1257651c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 97B8:363D8E:21CB267:2AE88F8:6B015F32 |
| html-safe-nonce | d73004743ab284d15647dec73c25e98bbe750b99ffe9a2afd891e79ab5e00ef3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5N0I4OjM2M0Q4RToyMUNCMjY3OjJBRTg4Rjg6NkIwMTVGMzIiLCJ2aXNpdG9yX2lkIjoiNzA3NDc5MTY0OTI3NjE1Nzc0NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4544b18c3b92b58d4266155e603a56c17c2f178bf09277a1ddca5aa469ceac32 |
| hovercard-subject-tag | pull_request:152907133 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/angular/angular/pull/20467/files |
| twitter:image | https://avatars.githubusercontent.com/u/799293?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/799293?s=400&v=4 |
| og:image:alt | url.pathname needs to remove baseHref otherwise it repeatedly gets added causing numerous redirects Fixes #20061 PR Checklist Please check if your PR fulfills the following requirements: The comm... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width