add URL isSameOrigin to WorkerGlobalScope

This commit is contained in:
Muki Kiboigo committed 2026-08-14 07:59:14 -07:00
1 parent fc8f89e157
commit bcea0afa24
1 file changed
+1 -5
+1 -5
View File
@@ -261,11 +261,7 @@ pub fn headersForRequest(self: *WorkerGlobalScope, transfer: *HttpClient.Transfe
pub fn isSameOrigin(self: *const WorkerGlobalScope, url: [:0]const u8) bool {
const current_origin = self.origin orelse return false;
if (!std.mem.startsWith(u8, url, current_origin)) {
return false;
}
return std.mem.eql(u8, URL.getHost(url), URL.getHost(current_origin));
return URL.isSameOrigin(url, current_origin);
}
pub fn makeRequest(self: *WorkerGlobalScope, req: HttpClient.Request) !void {