From c0932f20913931309881f1b961cd35bbb06f29c8 Mon Sep 17 00:00:00 2001 From: sis0k0 Date: Fri, 24 Jul 2026 21:50:56 +0300 Subject: [PATCH] Fix Codespaces host rejection in Angular SSR host check @angular/ssr's isHostAllowed only treats an allowedHosts entry as a wildcard when it starts with '*.', so the previous '.app.github.dev' entry was ignored and the forwarded Codespaces host was rejected with 'Header "x-forwarded-host" ... is not allowed'. - Use '*.app.github.dev' (the form @angular/ssr matches) in the build target's security.allowedHosts. - Add allowedHosts to the serve target too, since 'ng serve' validates against the dev-server's list (not the build security list). --- client/angular.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/angular.json b/client/angular.json index dfffeed..85fc0c3 100644 --- a/client/angular.json +++ b/client/angular.json @@ -30,7 +30,7 @@ "server": "src/main.server.ts", "outputMode": "server", "security": { - "allowedHosts": ["localhost", ".app.github.dev"] + "allowedHosts": ["localhost", "*.app.github.dev"] }, "ssr": { "entry": "server.ts" @@ -68,6 +68,9 @@ }, "serve": { "builder": "@angular/build:dev-server", + "options": { + "allowedHosts": ["*.app.github.dev"] + }, "configurations": { "production": { "buildTarget": "client:build:production"