Skip to content

Commit

Permalink
fix crashing when host is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
e9x committed Jul 8, 2023
1 parent 08c538e commit e207405
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/AbstractMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export class Request {
this.body = body;
this.method = init.method;
this.headers = new Headers(init.headers);
this.url = new URL(`http:${this.headers.get('host')}${init.path}`);
// Parse the URL pathname. Host doesn't matter.
this.url = new URL(init.path, 'http://bare-server-node');
}
}

Expand Down

0 comments on commit e207405

Please sign in to comment.