Skip to content

Fix invalid static request URLs when DISABLE_NGINX=1#493

Open
yohamta0 wants to merge 1 commit into
pk910:masterfrom
curvegrid:fix-static-url-parse
Open

Fix invalid static request URLs when DISABLE_NGINX=1#493
yohamta0 wants to merge 1 commit into
pk910:masterfrom
curvegrid:fix-static-url-parse

Conversation

@yohamta0
Copy link
Copy Markdown

This fixes a crash in PoWFaucet's built-in static file server when DISABLE_NGINX=1.

A request target like // makes new URL() throw while the faucet is resolving the static file path. The exception escapes the request handler and is picked up by PoWFaucet's uncaughtException handler, which shuts the process down with exit code 1 instead of returning an HTTP response.

This change:

  • returns 400 Bad Request when the static request URL cannot be parsed
  • keeps normal static file requests unchanged
  • adds a regression test for the // request

@yohamta0
Copy link
Copy Markdown
Author

Hi @pk910, we ran into a crash in the built-in static server when it receives an invalid request URL like //. This PR adds a small guard for that path and a regression test. Could you take a look when you have a chance? Thank you!

@yohamta0 yohamta0 force-pushed the fix-static-url-parse branch from 4132523 to c003722 Compare May 19, 2026 06:22
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.

1 participant