Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: remove Access-Control-Allow-Origin for robots.txt #15895

Merged
merged 2 commits into from
Apr 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading