commit 29c139d5fe24f2101aa9921e95d6381417dbd45d from: Omar Polo date: Fri Aug 13 08:46:51 2021 UTC correctly serialize file: URIs file URIs have the two slashes after the protocol even when the hostname is not specified. commit - 767da05cecb82ef3e8fe53a8bb977e4fd054a43b commit + 29c139d5fe24f2101aa9921e95d6381417dbd45d blob - c1fd7f956ce311a71f711189e6af8d8cee4fc297 blob + 6a58f46e28801ee0f98e8a8ed67576dc3f112b39 --- phos/phos_uri.c +++ phos/phos_uri.c @@ -893,7 +893,13 @@ phos_serialize_uri(const struct phos_uri *uri, char *b CAT(":"); } - if (*uri->host != '\0') { + if (*uri->host != '\0' || strcmp(uri->scheme, "file") == 0) { + /* + * The file URI scheme has a quirk that even if a + * hostname is not present, we still have to append + * the two slashes. This is why we have + * file:///etc/hosts and not file:/etc/hosts + */ CAT("//"); CAT(uri->host); }