authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-03-10 21:57:27 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-03-10 21:57:27 -07:00
logb9741fa658b461aa35e98b713984f9d7e396c16c
tree36005810241dbfca09fce6fd5f53fcac4951018c
parent42b824be718e4da7783c40730ad6777e9a9610ac
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

URL.portFancy() put these schemes in more of an order thats likely to be seen in the wild


1 files changed, 2 insertions(+), 2 deletions(-)

url.zig+2-2
...@@ -964,12 +964,12 @@ pub const URL = struct {...@@ -964,12 +964,12 @@ pub const URL = struct {
964 pub fn portFancy(u: *const URL) ?u16 {964 pub fn portFancy(u: *const URL) ?u16 {
965 if (u.port.len > 0) return extras.parseDigits(u16, u.port, 10) catch unreachable;965 if (u.port.len > 0) return extras.parseDigits(u16, u.port, 10) catch unreachable;
966 const s = u.scheme();966 const s = u.scheme();
967 if (std.mem.eql(u8, s, "ftp")) return 21;
968 if (std.mem.eql(u8, s, "file")) return null;
969 if (std.mem.eql(u8, s, "http")) return 80;967 if (std.mem.eql(u8, s, "http")) return 80;
970 if (std.mem.eql(u8, s, "https")) return 443;968 if (std.mem.eql(u8, s, "https")) return 443;
969 if (std.mem.eql(u8, s, "file")) return null;
971 if (std.mem.eql(u8, s, "ws")) return 80;970 if (std.mem.eql(u8, s, "ws")) return 80;
972 if (std.mem.eql(u8, s, "wss")) return 443;971 if (std.mem.eql(u8, s, "wss")) return 443;
972 if (std.mem.eql(u8, s, "ftp")) return 21;
973 return null;973 return null;
974 }974 }
975975