Fix a few subtle URI unescaping RFC compliant issues#693
Conversation
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
🤖 Augment PR SummarySummary: Updates the vendored Changes:
Technical Notes: These changes mainly affect edge cases around reserved-character escaping/unescaping and metaschema self-references/cycles. 🤖 Was this summary useful? React with 👍 or 👎 |
| @@ -132,9 +153,9 @@ auto URI::recompose_without_fragment() const -> std::optional<std::string> { | |||
| if (result_scheme.has_value() && !has_authority && | |||
| path_value.starts_with("/") && !path_value.starts_with("//")) { | |||
| escape_component_to_string(result, path_value.substr(1), | |||
There was a problem hiding this comment.
path_value.substr(1) drops the leading / when a scheme is present but there’s no authority, which can change scheme:/path into scheme:path (different URI semantics and potentially breaks round-tripping). Could we confirm this is intended for e.g. file:/... / http:/... forms?
Severity: high
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| } | ||
|
|
||
| // Path is already fully decoded, just return it | ||
| uri_unescape_all_inplace(path); |
There was a problem hiding this comment.
uri_unescape_all_inplace(path) happens after the Windows-absolute detection (/C:/), so inputs like file:///C%3A/Windows won’t be recognized as Windows paths before separator conversion/leading-slash handling. Consider whether unescaping needs to happen earlier to keep %3A-encoded drive letters working.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Signed-off-by: Juan Cruz Viotti jv@jviotti.com