Skip to content

Commit

Permalink
Move address bar spoofing server routes out of server.js (#180)
Browse files Browse the repository at this point in the history
* Change from PDF download to DMG download with 302 redirect.

This specific test case was not implemented correctly, instead we need a 302 redirect with a different binary format since PDFs render inside the browser instead of forcing downloads.

* Single quotify.

* Move security routes out of server.js.

* Whitespace fix.
  • Loading branch information
not-a-rootkit authored Dec 20, 2023
1 parent af7fc86 commit 5b3f123
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
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;
3 changes: 3 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,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);

0 comments on commit 5b3f123

Please sign in to comment.