Skip to content

Commit bb54747

Browse files
committed
fix(@angular/ssr): add leading slash to well-known non-Angular URLs
Pathnames always start with slash. (cherry picked from commit e565122)
1 parent c603548 commit bb54747

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/angular/ssr/src/app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ import { buildPathWithParams, joinUrlParts, stripLeadingSlash } from './utils/ur
3434
* bypass the Angular routing and rendering process.
3535
*/
3636
const WELL_KNOWN_NON_ANGULAR_URLS: ReadonlySet<string> = new Set<string>([
37-
'favicon.ico',
38-
'.well-known/appspecific/com.chrome.devtools.json',
37+
'/favicon.ico',
38+
'/.well-known/appspecific/com.chrome.devtools.json',
3939
]);
4040

4141
/**

packages/angular/ssr/test/app_spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ describe('AngularServerApp', () => {
139139
});
140140

141141
describe('handle', () => {
142+
it('should return null for well-known non-angular URLs', async () => {
143+
const response = await app.handle(
144+
new Request('http://localhost/.well-known/appspecific/com.chrome.devtools.json'),
145+
);
146+
147+
expect(response).toBeNull();
148+
});
149+
142150
describe('CSR and SSG pages', () => {
143151
it('should correctly render the content for the requested page', async () => {
144152
const response = await app.handle(new Request('http://localhost/home'));

0 commit comments

Comments
 (0)