[BUG] Attempted to assign to readonly property.
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- bun, javascript, node.js
Research direction
Reproduce the failure with bun install -g http-server, http-server -d false -i, and curl http://localhost:8080. Start with union/lib/response-stream.js at the _headerNames assignment and trace the request through union/lib/routing-stream.js and union/lib/core.js; done means the exception is handled and the host continues serving.
Written by the indexing model from the issue text.
Description
Environment Versions
- OS Type: Ubuntu 22.04.01 LTS
- Node version: node version unavailable. bun version 1.3.11
- http-server version: 14.1.1
Steps to reproduce
bun install -g http-serverhttp-server -d false -icurl http://localhost:8080
Expected result
Maybe 404? But at least capture the exception and keep serving the host.
Actual result
~# http-server -d false -i
Starting up http-server, serving ./
http-server version: 14.1.1
http-server settings:
CORS: disabled
Cache: 3600 seconds
Connection Timeout: 120 seconds
Directory Listings: not visible
AutoIndex: not visible
Serve GZIP Files: false
Serve Brotli Files: false
Default File Extension: none
<After curl the service>
48 |
49 | if (this.response) {
50 | this._headers = this.response._headers = this.response._headers || {};
51 |
52 | // Patch to node core
53 | this.response._headerNames = this.response._headerNames || {};
^
TypeError: Attempted to assign to readonly property.
at <anonymous> (node:_http_outgoing:360:17)
at new (/root/.bun/install/global/node_modules/union/lib/response-stream.js:53:10)
at new (/root/.bun/install/global/node_modules/union/lib/routing-stream.js:30:17)
at requestHandler (/root/.bun/install/global/node_modules/union/lib/core.js:27:25)
at emit (node:events:98:22)
at onNodeHTTPRequest (node:_http_server:367:22)
DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
code: "DEP0066"
at <anonymous> (internal:util/deprecate:9:30)
at deprecated (internal:util/deprecate:20:29)
at new (/root/.bun/install/global/node_modules/union/lib/response-stream.js:50:51)
at new (/root/.bun/install/global/node_modules/union/lib/routing-stream.js:30:17)
at requestHandler (/root/.bun/install/global/node_modules/union/lib/core.js:27:25)
at emit (node:events:98:22)
at onNodeHTTPRequest (node:_http_server:367:22)
Bun v1.3.11 (Linux x64)
After the error log, this process is self-terminated.
Other information
- Dominant language
- JavaScript
- Stars
- 14.2k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from http-party/http-server
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
http-party/http-server#977 · 1 reaction ·
-
New chet Open
Difficulty 5/5 Over a week Newbie friendliness 10/100
http-party/http-server#976 ·
-
Dreams local boy Open
Difficulty 5/5 Over a week Newbie friendliness 15/100
http-party/http-server#975 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
http-party/http-server#973 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
http-party/http-server#972 · 1 reaction ·
All issues in http-party/http-server
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·