aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-09-22 01:57:06 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-09-22 01:57:06 -0700
commite15fb6b9b220510df049e782d4f2f6eb3150d069 (patch)
tree26a3c1fa7907a000ee017f611a8d8eb2ec48970b
parentf1ffc72a624a31c7c16d5daad28facd40c7f73e2 (diff)
downloadbun-e15fb6b9b220510df049e782d4f2f6eb3150d069.tar.gz
bun-e15fb6b9b220510df049e782d4f2f6eb3150d069.tar.zst
bun-e15fb6b9b220510df049e782d4f2f6eb3150d069.zip
[breaking] Bun.serve().hostname should return the hostname instead of the baseURI
Previously Bun.serve().hostname was returning the baseURI, effectively the `origin` That was incorrect. Instead, it should be returning the hostname
-rw-r--r--src/bun.js/api/server.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig
index c3501019a..12b383f05 100644
--- a/src/bun.js/api/server.zig
+++ b/src/bun.js/api/server.zig
@@ -2007,7 +2007,7 @@ pub fn NewServer(comptime ssl_enabled_: bool, comptime debug_mode_: bool) type {
}
pub fn getHostname(this: *ThisServer, globalThis: *JSGlobalObject) JSC.JSValue {
- return ZigString.init(this.config.base_uri).toValue(globalThis);
+ return ZigString.init(bun.span(this.config.hostname)).toValue(globalThis);
}
pub fn getDevelopment(