Skip to content

Commit

Permalink
fix: show users-agent from correct request
Browse files Browse the repository at this point in the history
  • Loading branch information
jirikrepl committed Jan 14, 2022
1 parent 2102278 commit 4690231
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.DS_Store
.DS_Store
/.idea/
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var prerender = module.exports = function(req, res, next) {

if(prerenderedResponse){
res.writeHead(prerenderedResponse.statusCode, prerenderedResponse.headers);
console.log(`pre-rendered response ${prerenderedResponse.statusCode} for: ${prerenderedResponse.headers['user-agent']}`);
console.log(`pre-rendered response ${prerenderedResponse.statusCode} for: ${req.headers['user-agent']}`);
return res.end(prerenderedResponse.body);
} else {
next(err);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jirkakrepl/prerender-node",
"version": "3.4.1",
"version": "3.4.2",
"description": "express middleware for serving prerendered javascript-rendered pages for SEO",
"author": "Todd Hooper",
"license": "MIT",
Expand Down

0 comments on commit 4690231

Please sign in to comment.