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

Move address bar spoofing server routes out of server.js #180

Merged
merged 6 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions security/address-bar-spoofing/server/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const express = require('express');
const router = express.Router();

// Returns a 301 redirect to a download link of our browser
// for use in the download path test
router.get('/download-redirect', (req, res) => {
res.redirect(301, 'https://staticcdn.duckduckgo.com/macos-desktop-browser/duckduckgo.dmg');
});

module.exports = router;
2 changes: 1 addition & 1 deletion security/address-bar-spoofing/spoof-js-download-url.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
const w = open()
w.opener = null
w.document.write('<h1>Not DDG.</h1>')
w.location = 'https://tyny.to/s509a8'
w.location = '/security/address-bar-spoofing/download-redirect'
}
</script>
</head>
Expand Down
3 changes: 3 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,6 @@ app.use('/features/client-hints', chRoutes);

const clearDataRoutes = require('./features/clear-data/server/routes.js');
app.use('/features/clear-data', clearDataRoutes);

const addressBarSpoofingRoutes = require('./security/address-bar-spoofing/server/routes.js');
app.use('/security/address-bar-spoofing', addressBarSpoofingRoutes);
Loading