mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-09-28 15:35:43 -04:00
add URL isSameOrigin to WorkerGlobalScope
This commit is contained in:
1 file changed
+1
-5
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user