mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
normalize 443
This commit is contained in:
@@ -3340,7 +3340,7 @@ fn NewSocket(comptime ssl: bool) type {
|
||||
if (servername == null) {
|
||||
return JSValue.jsUndefined();
|
||||
}
|
||||
return ZigString.fromUTF8(servername[0..bun.len(servername)]).toJS(globalObject);
|
||||
return bun.String.createUTF8ForJS(globalObject, servername[0..bun.len(servername)]);
|
||||
}
|
||||
pub fn setServername(
|
||||
this: *This,
|
||||
|
||||
@@ -2299,7 +2299,7 @@ function initOriginSet(session: Http2Session) {
|
||||
}
|
||||
}
|
||||
let originString = `https://${hostName}`;
|
||||
if (socket.remotePort != null) originString += `:${socket.remotePort}`;
|
||||
if (socket.remotePort != null && socket.remotePort != 443) originString += `:${socket.remotePort}`;
|
||||
originSet.add(originString);
|
||||
}
|
||||
return originSet;
|
||||
|
||||
@@ -4,6 +4,13 @@ import { tls } from "harness";
|
||||
import http2 from "http2";
|
||||
import { once } from "events";
|
||||
|
||||
test("can make http2 request using servername", async () => {
|
||||
// actually using a servername
|
||||
const response = await got("https://example.com", {
|
||||
http2: true,
|
||||
});
|
||||
expect(response.statusCode).toBe(200);
|
||||
});
|
||||
test("can make http2 request to local http2 server", async () => {
|
||||
const server = http2.createSecureServer(tls);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user