We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b87a80a + 2230723 commit 64bd4deCopy full SHA for 64bd4de
src/url.zig
@@ -13,7 +13,14 @@ pub const URL = struct {
13
// In most cases though, we assume the caller will just dupe the string URL
14
// into an arena
15
pub fn parse(str: []const u8, default_scheme: ?[]const u8) !URL {
16
- const uri = Uri.parse(str) catch try Uri.parseAfterScheme(default_scheme orelse "https", str);
+ var uri = Uri.parse(str) catch try Uri.parseAfterScheme(default_scheme orelse "https", str);
17
+
18
+ // special case, url scheme is about, like about:blank.
19
+ // Use an empty string as host.
20
+ if (std.mem.eql(u8, uri.scheme, "about")) {
21
+ uri.host = .{ .percent_encoded = "" };
22
+ }
23
24
if (uri.host == null) {
25
return error.MissingHost;
26
}
0 commit comments