Challenge 1
Echo the caller's origin — never the wildcard.
app.use((req, res, next) => {
res.setHeader('Access-Control-Allow-Origin', ;
});
Press Ctrl⌘Enter to check your answer
Fill in the missing response headers a credentialed beacon collector must send.
Challenge 1
app.use((req, res, next) => {
res.setHeader('Access-Control-Allow-Origin', ;
});
Press Ctrl⌘Enter to check your answer
Challenge 2
res.setHeader('Access-Control-Allow-Credentials', '');
Press Ctrl⌘Enter to check your answer
Challenge 3
res.setHeader('', 'Origin');
Press Ctrl⌘Enter to check your answer
Challenge 4
if (req.method === 'OPTIONS') {
res.setHeader('Access-Control-Allow-Methods', '');
return res.sendStatus(204);
}
Press Ctrl⌘Enter to check your answer
Challenge 5
// fire-and-forget: the server is encouraged to reply with
res.sendStatus();
Press Ctrl⌘Enter to check your answer