authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-01-22 16:43:49 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-01-22 16:54:55 -08:00
loga8eff70a99f05c0837b60b138c395b0f6d4000ff
treef28083a06a39671bedef76b1841397cb2d5afe20
parentcc06e6709bb5af14867d8cdd82daebbe7f4b22a8

populate port field


3 files changed, 4 insertions(+), 2 deletions(-)

generate.ts+1-1
......@@ -54,7 +54,7 @@ pub fn parsePass(input: []const u8, base: ?[]const u8, href: []const u8, origin:
5454 try expect(u.password).toEqualString(password);
5555 _ = host;
5656 _ = hostname;
57 _ = port;
57 try expect(u.port).toEqualString(port);
5858 _ = pathname;
5959 _ = search;
6060 _ = hash;
url.zig+2
......@@ -10,6 +10,7 @@ pub const URL = struct {
1010 protocol: []const u8,
1111 username: []const u8,
1212 password: []const u8,
13 port: []const u8,
1314
1415 pub const HostKind = enum {
1516 name,
......@@ -783,6 +784,7 @@ pub const URL = struct {
783784 .protocol = _href[0..extras.sum(usize, href.lengths[0..2])],
784785 .username = _href[extras.sum(usize, href.lengths[0..2])..][0..href.lengths[3]],
785786 .password = _href[extras.sum(usize, href.lengths[0..4])..][0..href.lengths[5]],
787 .port = _href[extras.sum(usize, href.lengths[0..8])..][0..href.lengths[9]],
786788 };
787789 return url;
788790 }
zig-out/test.zig+1-1
......@@ -24,7 +24,7 @@ pub fn parsePass(input: []const u8, base: ?[]const u8, href: []const u8, origin:
2424 try expect(u.password).toEqualString(password);
2525 _ = host;
2626 _ = hostname;
27 _ = port;
27 try expect(u.port).toEqualString(port);
2828 _ = pathname;
2929 _ = search;
3030 _ = hash;