mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-06-11 01:25:53 -04:00
Merge pull request #2568 from lightpanda-io/navigate_schemaless_url
Improve navigate to schema-less URL
This commit is contained in:
@@ -632,7 +632,12 @@ pub fn navigate(self: *Frame, request_url: [:0]const u8, opts: NavigateOpts) !vo
|
||||
self._http_status = null;
|
||||
self._http_headers = .empty;
|
||||
|
||||
self.url = try self.arena.dupeZ(u8, request_url);
|
||||
self.url = blk: {
|
||||
if (URL.isCompleteHTTPUrl(request_url)) {
|
||||
break :blk try self.arena.dupeZ(u8, request_url);
|
||||
}
|
||||
break :blk try std.mem.concatWithSentinel(self.arena, u8, &.{ "http://", request_url }, 0);
|
||||
};
|
||||
self.origin = try URL.getOrigin(self.arena, self.url);
|
||||
|
||||
self._req_id = req_id;
|
||||
|
||||
Reference in New Issue
Block a user