question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

req.host deprecated. use req.hostname

See original GitHub issue

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

5.18.0

Description

GMT express deprecated req.host: Use req.hostname instead at node_modules/@sentry/node/dist/handlers.js:95:36

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kamilogorekcommented, Aug 16, 2022

If that happens, it means that somehow req.hostname is not present, and it should. Most likely something is changing the shape of req object prior to reaching our middleware. We cannot do anything at the stage of reading the data - https://github.com/getsentry/sentry-javascript/blob/380f483d06355635e98b7ded7ffef7c7780ff891/packages/utils/src/requestdata.ts#L244

1reaction
kamilogorekcommented, Jul 2, 2021

Closing the issue as a part of large repository cleanup, due to it being inactive and/or outdated. Please do not hesitate to ping me if it is still relevant, and I will happily reopen and work on it. Cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Express deprecation warning for `req.host` · Issue #96 - GitHub
very easy to fix - I swapped it locally but every time I install the package it throws this error again - please...
Read more >
body parser and html depreceated - Stack Overflow
express deprecated req.host: Use req.hostname instead node_modules\body-parser\index.js:100:29. Please let me know what steps to take. body-parser.
Read more >
Express.js req.hostname Property - GeeksforGeeks
The req.hostname property contains the hostname which is derived from the Host HTTP header. It basically returns the hostname which is being ...
Read more >
req.host - Sails.js
This method is deprecated and will likely be removed or changed in an upcoming release. Instead, use req. hostname. The hostname of this...
Read more >
expressjs: is it bad practice to use req.hostname for querying a ...
I'm thinking about using kubernetes and dockers containers to isolate version ... domainToken, host = req.hostname; req.params.token = host ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found