Skip to content

Commit

Permalink
tests: remove Access-Control-Allow-Origin for robots.txt (#15895)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Apr 1, 2024
1 parent 0475357 commit 5827da9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cli/test/fixtures/static-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5827da9

Please sign in to comment.