UNPKG

491 BJavaScriptView Raw
1module.exports = ({
2 router,
3}) => {
4
5 router.all('/debug/useragent.:ext?', (req, res) => {
6 const expressUseragent = require('express-useragent');
7 const useragent = expressUseragent.parse(req.headers['user-agent']);
8
9 res.status(200);
10 res.send(`
11 <html>
12 <head>
13 <title>${useragent.source}</title>
14 <meta name="description" content="${useragent.source}">
15 </head>
16 <body>${useragent.source}</body>
17 </html>
18 `);
19 });
20
21};