Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error from remoteAddr if the socket goes away #4395

Closed
joshkel opened this issue Nov 16, 2022 · 1 comment · Fixed by #4396
Closed

Error from remoteAddr if the socket goes away #4395

joshkel opened this issue Nov 16, 2022 · 1 comment · Fixed by #4396
Labels
support Questions, discussions, and general support

Comments

@joshkel
Copy link
Contributor

joshkel commented Nov 16, 2022

Support plan

  • is this issue currently blocking your project? (yes/no): no
  • is this issue affecting a production system? (yes/no): yes

Context

  • node version: 14.21.1
  • module version with issue: 21.0.0
  • last module version without issue: 20.2.2
  • environment (e.g. node, browser, native): Node
  • used with (e.g. hapi application, another framework, standalone, ...): Hapi application
  • any other relevant information:

What are you trying to achieve or the steps to reproduce?

Accessing request.info.remoteAddress may fail if the remote socket has gone away.

This appears to be the result of #4357.

What was the result you got?

TypeError: Cannot read property 'startsWith' of undefined
    at internals.Info.get remoteAddress [as remoteAddress] (/home/deploy/node_modules/@hapi/hapi/lib/request.js:661:31)

What result did you expect?

A successful undefined value

@joshkel joshkel added the support Questions, discussions, and general support label Nov 16, 2022
joshkel added a commit to joshkel/hapi that referenced this issue Nov 16, 2022
@lillyluo
Copy link

thanks @joshkel - also experiencing this issue. would be great to get the patch in

devinivy added a commit that referenced this issue Dec 1, 2022
* Fix handling of no remoteAddress available

Fixes #4395

* Tidy tests

Co-authored-by: David McKeown <[email protected]>

* Lint

Co-authored-by: devin ivy <[email protected]>
Co-authored-by: David McKeown <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Questions, discussions, and general support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants