Skip to content

Commit 16c4f35

Browse files
authored
fix: avoid blocking URL ending with routes.json (#185)
Fixes #183
1 parent acad12f commit 16c4f35

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/proxy/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ const requestHandler = (userConfig: SWAConfigFile | null) =>
174174
}
175175

176176
// don't serve staticwebapp.config.json / routes.json
177-
if (req.url.endsWith(DEFAULT_CONFIG.swaConfigFilename!) || req.url.endsWith(DEFAULT_CONFIG.swaConfigFilenameLegacy!)) {
177+
if (req.url.endsWith(`/${DEFAULT_CONFIG.swaConfigFilename!}`) || req.url.endsWith(`/${DEFAULT_CONFIG.swaConfigFilenameLegacy!}`)) {
178178
req.url = "404.html";
179179
res.statusCode = 404;
180180
serve(SWA_PUBLIC_DIR, req, res);
181181

182-
logRequest(req, PROTOCOL + "://" + req.headers.host + req.url, 404);
182+
logRequest(req, PROTOCOL + "://" + req.headers.host, 404);
183183
}
184184

185185
// proxy AUTH request to AUTH emulator

0 commit comments

Comments
 (0)