-
Notifications
You must be signed in to change notification settings - Fork 26.2k
fix(docs-infra): configure Firebase to strip off the .html
extension
#25999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
You can preview 52f3a71 at https://pr25999-52f3a71.ngbuilds.io/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess there are actually no cases where we expect there to be a .html
extension on a URL in practice?
Do we care about .htm
?
LGTM
Not afaict 😁
Not afaict. Actually, I inteded to add an e2e test, but forgot it. I'll add it later. |
Blocked on #25997 (for patch branch). |
Firebase used to do it automatically (with `cleanUrls: true`), but it stopped doing it unless the resulting URL corresponds to an existing file (which is not always the case in angular.io; e.g. the resulting URL might be matched by a new redirect rule). This change in Firebase hosting behavior resulted in some URLs not being correctly redirected (e.g. URLs to the archived v2 site, or `.html` suffixed URLs from 3rd-party sites). This commit fixes it, by configuring Firebase hosting to strip off the `.html` extension and redirect (if no other redirect rule matched).
52f3a71
to
764717a
Compare
You can preview 764717a at https://pr25999-764717a.ngbuilds.io/. |
Rebased on master and added an e2e test. This should be good to go once #25997 is merged. |
page.sitemapUrls.forEach((url, i) => { | ||
it(`should not redirect '${url}' (${i + 1}/${page.sitemapUrls.length})`, async () => { | ||
await page.goTo(url); | ||
page.sitemapUrls.forEach((path, i) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this rename?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For clarity 😇
These are paths and it didn't read correctly to have baseUrl + url --> someUrl
.
path
is a more accurate name for what this variable holds 😃
angular#25999) Firebase used to do it automatically (with `cleanUrls: true`), but it stopped doing it unless the resulting URL corresponds to an existing file (which is not always the case in angular.io; e.g. the resulting URL might be matched by a new redirect rule). This change in Firebase hosting behavior resulted in some URLs not being correctly redirected (e.g. URLs to the archived v2 site, or `.html` suffixed URLs from 3rd-party sites). This commit fixes it, by configuring Firebase hosting to strip off the `.html` extension and redirect (if no other redirect rule matched). PR Close angular#25999
angular#25999) Firebase used to do it automatically (with `cleanUrls: true`), but it stopped doing it unless the resulting URL corresponds to an existing file (which is not always the case in angular.io; e.g. the resulting URL might be matched by a new redirect rule). This change in Firebase hosting behavior resulted in some URLs not being correctly redirected (e.g. URLs to the archived v2 site, or `.html` suffixed URLs from 3rd-party sites). This commit fixes it, by configuring Firebase hosting to strip off the `.html` extension and redirect (if no other redirect rule matched). PR Close angular#25999
angular#25999) Firebase used to do it automatically (with `cleanUrls: true`), but it stopped doing it unless the resulting URL corresponds to an existing file (which is not always the case in angular.io; e.g. the resulting URL might be matched by a new redirect rule). This change in Firebase hosting behavior resulted in some URLs not being correctly redirected (e.g. URLs to the archived v2 site, or `.html` suffixed URLs from 3rd-party sites). This commit fixes it, by configuring Firebase hosting to strip off the `.html` extension and redirect (if no other redirect rule matched). PR Close angular#25999
#25999) (#25997) Firebase used to do it automatically (with `cleanUrls: true`), but it stopped doing it unless the resulting URL corresponds to an existing file (which is not always the case in angular.io; e.g. the resulting URL might be matched by a new redirect rule). This change in Firebase hosting behavior resulted in some URLs not being correctly redirected (e.g. URLs to the archived v2 site, or `.html` suffixed URLs from 3rd-party sites). This commit fixes it, by configuring Firebase hosting to strip off the `.html` extension and redirect (if no other redirect rule matched). PR Close #25999 PR Close #25997
angular#25999) Firebase used to do it automatically (with `cleanUrls: true`), but it stopped doing it unless the resulting URL corresponds to an existing file (which is not always the case in angular.io; e.g. the resulting URL might be matched by a new redirect rule). This change in Firebase hosting behavior resulted in some URLs not being correctly redirected (e.g. URLs to the archived v2 site, or `.html` suffixed URLs from 3rd-party sites). This commit fixes it, by configuring Firebase hosting to strip off the `.html` extension and redirect (if no other redirect rule matched). PR Close angular#25999
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Firebase used to do it automatically (with
cleanUrls: true
), but it stopped doing it unless the resulting URL corresponds to an existing file (which is not always the case in angular.io; e.g. the resulting URL might be matched by a new redirect rule).This change in Firebase hosting behavior resulted in some URLs not being correctly redirected (e.g. URLs to the archived v2 site, or
.html
suffixed URLs from 3rd-party sites).This commit fixes it, by configuring Firebase hosting to strip off the
.html
extension and redirect (if no other redirect rule matched).