@@ -12,6 +12,7 @@ import '@angular/compiler';
1212/* eslint-enable import/no-unassigned-import */
1313
1414import { Component , REQUEST , inject } from '@angular/core' ;
15+ import { INITIAL_CONFIG } from '@angular/platform-server' ;
1516import { destroyAngularServerApp , getOrCreateAngularServerApp } from '../src/app' ;
1617import { AngularAppEngine } from '../src/app-engine' ;
1718import { setAngularAppEngineManifest } from '../src/manifest' ;
@@ -290,9 +291,13 @@ describe('AngularAppEngine', () => {
290291 beforeAll ( ( ) => {
291292 @Component ( {
292293 selector : 'app-home' ,
293- template : `Home works` ,
294+ template : `Home works {{ trustedHosts }} ` ,
294295 } )
295- class HomeComponent { }
296+ class HomeComponent {
297+ protected readonly trustedHosts = (
298+ inject ( INITIAL_CONFIG ) as { allowedHosts ?: readonly string [ ] }
299+ ) . allowedHosts ?. join ( ',' ) ;
300+ }
296301
297302 setAngularAppEngineManifest ( {
298303 allowedHosts : [ 'example.com' ] ,
@@ -334,6 +339,12 @@ describe('AngularAppEngine', () => {
334339 expect ( await response ?. text ( ) ) . toContain ( 'Home works' ) ;
335340 } ) ;
336341
342+ it ( 'marks internal platform URLs as already validated' , async ( ) => {
343+ const request = new Request ( 'https://example.com/home' ) ;
344+ const response = await appEngine . handle ( request ) ;
345+ expect ( await response ?. text ( ) ) . toContain ( 'Home works *' ) ;
346+ } ) ;
347+
337348 it ( 'should correctly render the content when the URL ends with "index.html"' , async ( ) => {
338349 const request = new Request ( 'https://example.com/home/index.html' ) ;
339350 const response = await appEngine . handle ( request ) ;
0 commit comments