Repository: http-party/http-server

Issue #671: OPTIONS Requests Crash App
Created: 2021-01-08T22:08:19Z
Steps to reproduce the issue, if applicable. Include the actual command and output and/or stack trace.
curl -i -X OPTIONS http://example.org/path
OR
curl -i --request-target "*" -X OPTIONS http://example.org
What did you expect to happen?
Webserver should not crash.
Output in the log looks like this, and it grows and grows until the app crashes.
[Fri Jan 08 2021 14:24:20 GMT-0500 (Eastern Standard Time)] "OPTIONS /" "curl/7.60.0"
[Fri Jan 08 2021 14:24:20 GMT-0500 (Eastern Standard Time)] "OPTIONS /?/" "curl/7.60.0"
[Fri Jan 08 2021 14:24:20 GMT-0500 (Eastern Standard Time)] "OPTIONS /?/?/" "curl/7.60.0"
[Fri Jan 08 2021 14:24:20 GMT-0500 (Eastern Standard Time)] "OPTIONS /?/?/?/" "curl/7.60.0"
[Fri Jan 08 2021 14:24:20 GMT-0500 (Eastern Standard Time)] "OPTIONS /?/?/?/?/" "curl/7.60.0"
[Fri Jan 08 2021 14:24:20 GMT-0500 (Eastern Standard Time)] "OPTIONS /?/?/?/?/?/" "curl/7.60.0"
[Fri Jan 08 2021 14:24:20 GMT-0500 (Eastern Standard Time)] "OPTIONS /?/?/?/?/?/?/" "curl/7.60.0"
[Fri Jan 08 2021 14:24:20 GMT-0500 (Eastern Standard Time)] "OPTIONS /?/?/?/?/?/?/?/" "curl/7.60.0"
[Fri Jan 08 2021 14:24:20 GMT-0500 (Eastern Standard Time)] "OPTIONS /?/?/?/?/?/?/?/?/" "curl/7.60.0"
[Fri Jan 08 2021 14:24:20 GMT-0500 (Eastern Standard Time)] "OPTIONS /?/?/?/?/?/?/?/?/?/" "curl/7.60.0"
[Fri Jan 08 2021 14:24:20 GMT-0500 (Eastern Standard Time)] "OPTIONS /?/?/?/?/?/?/?/?/?/?/" "curl/7.60.0"
[Fri Jan 08 2021 14:24:20 GMT-0500 (Eastern Standard Time)] "OPTIONS /?/?/?/?/?/?/?/?/?/?/?/" "curl/7.60.0"
[Fri Jan 08 2021 14:24:20 GMT-0500 (Eastern Standard Time)] "OPTIONS /?/?/?/?/?/?/?/?/?/?/?/?/" "curl/7.60.0"
[Fri Jan 08 2021 14:24:20 GMT-0500 (Eastern Standard Time)] "OPTIONS /?/?/?/?/?/?/?/?/?/?/?/?/?/" "curl/7.60.0"
If the issue is a feature request, what is the motivation / use case for it?
Tell us about your environment

exact http-server version:

├─┬ http-server@0.11.1
│ ├── colors@1.0.3
│ ├── corser@2.0.1
│ ├─┬ ecstatic@3.3.0
│ │ ├── he@1.2.0
│ │ ├── mime@1.6.0
│ │ ├── minimist@1.2.0
│ │ └── url-join@2.0.5
│ ├─┬ http-proxy@1.17.0
│ │ ├── eventemitter3@3.1.0
│ │ ├─┬ follow-redirects@1.6.1
│ │ │ └─┬ debug@3.1.0
│ │ │   └── ms@2.0.0 deduped
│ │ └── requires-port@1.0.0
│ ├── opener@1.4.3
│ ├─┬ optimist@0.6.1
│ │ ├── minimist@0.0.10
│ │ └── wordwrap@0.0.3
│ ├─┬ portfinder@1.0.20
│ │ ├── async@1.5.2
│ │ ├─┬ debug@2.6.9
│ │ │ └── ms@2.0.0
│ │ └─┬ mkdirp@0.5.1
│ │   └── minimist@0.0.8
│ └─┬ union@0.4.6
│   └── qs@2.3.3


Node version:
v10.23.0


Platform:
Red Hat Enterprise Linux Server release 7.9 (Maipo)

Duplicate issue #636: Proxy causing infinite loop
Created: 2020-06-25T17:09:19Z
Built project into a folder /dist/ui/
cd into /build
run command:
http-server -p 9000 --cors='*' --proxy http://localhost:9000/ui?
I was able to see the app running by navigating to http://localhost:9000/ui. I clicked on a client-side route like http://localhost:9000/ui/reports handled by reach-router. The app served as expected. I hit refresh in the browser. I hoped it would fallback to ui/ and rerender the /reports route (like it does in the webpack-dev-server). Instead I saw
"GET /ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/ui/favicon.ico

in the terminal and
Error: ENAMETOOLONG: name too long, stat '/Users/<name>/path/to/project/dist/ui/ui/ui/ui/ui/ui/ ...
I'm on Mac OS X 10.15.4
http-server v0.12.3
node 10.16.0

Closing comment (2021-08-17T14:01:09Z): Possibly the same as #671 and/or #525. Is this still ocurring with http-server v13.0.0?