Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid double-escaping in url_escape (#30)
Because the escapes for other characters will put `%` into the output text, we need to perform replacements for `%` first. This ensures that all chars we replace this way were from the input text and not put there by some prior replacement step. The prior implementation would produce double-escaped values for the following characters: | Input char | Double-escaped | Fixed | | ---------- | -------------- | ------- | | `" "` | `"%2520"` | `"%20"` | | `"!"` | `"%2521"` | `"%21"` | | `'"'` | `"%2522"` | `"%22"` | | `"#"` | `"%2523"` | `"%23"` | | `"$"` | `"%2524"` | `"%24"` | Co-authored-by: Jason Hall <jason@chainguard.dev>
- Loading branch information