Skip to content

Commit 05a2ce9

Browse files
committed
Handle inbound H2 as well
1 parent 6e54e20 commit 05a2ce9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/public-endpoint-server.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ export class PublicEndpointServer {
4040
}
4141

4242
private handleRequest(req: http.IncomingMessage, res: http.ServerResponse) {
43-
const hostHeader = req.headers['host'] || '';
44-
const [hostname, port] = hostHeader.split(':');
43+
const hostHeader = req.headers[':authority'] as string | undefined ||
44+
req.headers['host'] ||
45+
'';
46+
const [hostname] = hostHeader.split(':');
4547
console.log(`Received public endpoint request for host: ${hostHeader}, url: ${req.url}`);
4648

4749
if (!hostname.endsWith(this.rootDomain)) {

0 commit comments

Comments
 (0)