Skip to content

Commit

Permalink
fix percent encoding on control chars
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Dec 6, 2024
1 parent 1c61c39 commit 1318d46
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/util.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ let percent_encode ?(skip = fun _ -> false) s =
| ( ' ' | '!' | '"' | '#' | '$' | '%' | '&' | '\'' | '(' | ')' | '*' | '+'
| ',' | '/' | ':' | ';' | '=' | '?' | '@' | '[' | ']' | '~' ) as c ->
Printf.bprintf buf "%%%X" (Char.code c)
| c when Char.code c > 127 -> Printf.bprintf buf "%%%X" (Char.code c)
| c when Char.code c < 32 || Char.code c > 127 ->
Printf.bprintf buf "%%%X" (Char.code c)
| c -> Buffer.add_char buf c)
s;
Buffer.contents buf
Expand Down

0 comments on commit 1318d46

Please sign in to comment.