Skip to content

Conversation

brpvieira
Copy link
Contributor

In node versions > 10 fs.stat throws invalid path errors synchronously, this crashes node-static as described here.
Wrapping the fs.stat call in try .. catch block allows node-static to gracefully respond to the bad request with a 404.

Prevents uncaught exception:
TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string or Uint8Array without null bytes.
@brettz9 brettz9 merged commit 78879dc into cloudhead:master May 21, 2021
Zarel pushed a commit to Zarel/node-static that referenced this pull request Aug 10, 2021
Prevents uncaught exception:
TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string or Uint8Array without null bytes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants