Skip to content

Commit

Permalink
Allow IncomingRequest.req to be overwritten. (#4154)
Browse files Browse the repository at this point in the history
* Allow IncomingRequest.req to be overwritten.

* add test

* fix test

* yoo
  • Loading branch information
paperclover authored Aug 17, 2023
1 parent b2f8ef4 commit f74585f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
6 changes: 1 addition & 5 deletions src/js/node/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ class IncomingMessage extends Readable {
this.#fakeSocket = socket;

this.url = url.pathname + url.search;
this.#nodeReq = nodeReq;
this.#nodeReq = this.req = nodeReq;
assignHeaders(this, req);
}

Expand All @@ -624,10 +624,6 @@ class IncomingMessage extends Readable {
#type;
#nodeReq;

get req() {
return this.#nodeReq;
}

_construct(callback) {
// TODO: streaming
if (this.#type === "response" || this.#noBody) {
Expand Down
Loading

0 comments on commit f74585f

Please sign in to comment.