From 8cabbff40d693c6de47c5cb896f88650920a2b46 Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Mon, 1 Apr 2024 11:31:01 -0700 Subject: [PATCH] tests: remove Access-Control-Allow-Origin for robots.txt (#15895) --- cli/test/fixtures/static-server.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cli/test/fixtures/static-server.js b/cli/test/fixtures/static-server.js index c39e923a6051..b39072da3a3a 100644 --- a/cli/test/fixtures/static-server.js +++ b/cli/test/fixtures/static-server.js @@ -109,6 +109,12 @@ class Server { 'Origin-Agent-Cluster': '?1', }; + // This enables an important test in Smokerider - to check if the universal fetcher + // used for robots.txt (and source maps) is able to fetch freely while ignoring CORS constraints. + if (filePath === '/robots.txt') { + delete headers['Access-Control-Allow-Origin']; + } + const contentType = mime.lookup(filePath); const charset = mime.lookup(contentType); // `mime.contentType` appends the correct charset too.