fix(@angular/ssr): add leading slash to well-known non-Angular URLs · angular/angular-cli@bb54747

2 files changed

lines changed

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

/**

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'));