Skip to content

Commit

Permalink
Update EXPRESS_SERVER.MD (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
whimsicaldreamer authored Dec 11, 2023
1 parent 558f8df commit 0cd8c2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/EXPRESS_SERVER.MD
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const hasBotResult = (result) => {
// create middleware
const middlewareDetect = (req, res, next) => {
const useragent = req.headers['user-agent'];
const clientHintsData = clientHints.parse(res.headers);
const clientHintsData = clientHints.parse(req.headers);

req.useragent = useragent;
req.device = deviceDetector.detect(useragent, clientHintsData);
Expand All @@ -46,4 +46,4 @@ app.get('/detect', (req, res) => {
app.listen(port, () => {
console.log('server listen port %s', port);
})
```
```

0 comments on commit 0cd8c2c

Please sign in to comment.