open-standards/wai/http-conformance/falsify/uri-dots-kept.patch

24 lines
1.2 KiB
Diff

# must fail: uri_resolve_rfc_02 uri_resolve_rfc_17 live_relisted_dot_alias
# dot segments kept in a resolved URL (http_binding::uri::resolve)
diff --git a/wai/wai-rs/src/http_binding/uri.rs b/wai/wai-rs/src/http_binding/uri.rs
index 0f23cf96..140ead1a 100644
--- a/wai/wai-rs/src/http_binding/uri.rs
+++ b/wai/wai-rs/src/http_binding/uri.rs
@@ -127,7 +127,7 @@ pub fn resolve(base: &str, reference: &str) -> String {
Parts { scheme: b.scheme, authority: b.authority, path: remove_dot_segments(&r.path), query: r.query }
} else {
let merged = merge(&b, &r.path);
- Parts { scheme: b.scheme, authority: b.authority, path: remove_dot_segments(&merged), query: r.query }
+ Parts { scheme: b.scheme, authority: b.authority, path: merged, query: r.query }
};
let mut out = String::new();
if let Some(s) = &t.scheme {
@@ -146,7 +146,7 @@ pub fn resolve(base: &str, reference: &str) -> String {
None => out.push_str(&a.to_ascii_lowercase()),
}
}
- out.push_str(&remove_dot_segments(&normalize_percent(&t.path)));
+ out.push_str(&normalize_percent(&t.path));
if let Some(q) = &t.query {
out.push('?');
out.push_str(&normalize_percent(q));