commit 7aeb37b9291072f5fdad9b7e7864b4de65a066bc
parent b7cb1f622c4c138408369f0f4ef4bef868a5c717
Author: Tom Lebreux <me@tomlebreux.com>
Date: Mon, 30 May 2022 17:51:33 -0400
net::uri: fix missing // for file uri
Signed-off-by: Tom Lebreux <me@tomlebreux.com>
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/uri/fmt.ha b/net/uri/fmt.ha
@@ -20,7 +20,8 @@ export fn fmt(out: io::handle, u: *const uri) (size | io::error) = {
};
match (u.host) {
case let host: str =>
- if (len(host) > 0) {
+ // file scheme is allowed an empty host
+ if (len(host) > 0 || u.scheme == "file") {
if (!slashes_w) {
n += fmt::fprint(out, "//")?;
};