summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_string.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2020-03-27 17:22:52 +0300
committerValentin Bartenev <vbart@nginx.com>2020-03-27 17:22:52 +0300
commitd4b4cb0438d753e7694f8f76c41207bbe01fe790 (patch)
tree96a19d74ec96370aae0b57100592d3892b87d705 /src/nxt_string.c
parent8d727774e3a2b2eaf194781c382fb953ed61f755 (diff)
downloadunit-d4b4cb0438d753e7694f8f76c41207bbe01fe790.tar.gz
unit-d4b4cb0438d753e7694f8f76c41207bbe01fe790.tar.bz2
Updated URI escaping table for better conformity with RFC 3986.
Now '>', '<', '"', '^', '\', '}', '|', '{', and '`' are also escaped.
Diffstat (limited to 'src/nxt_string.c')
-rw-r--r--src/nxt_string.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/nxt_string.c b/src/nxt_string.c
index d567883f..dfaea6bc 100644
--- a/src/nxt_string.c
+++ b/src/nxt_string.c
@@ -521,19 +521,17 @@ nxt_encode_uri(u_char *dst, u_char *src, size_t length)
static const u_char hex[16] = "0123456789ABCDEF";
- /* " ", "#", "%", "?", %00-%1F, %7F-%FF */
-
static const uint32_t escape[] = {
0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
/* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */
- 0x80000029, /* 1000 0000 0000 0000 0000 0000 0010 1001 */
+ 0xd000002d, /* 1101 0000 0000 0000 0000 0000 0010 1101 */
/* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */
- 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */
+ 0x50000000, /* 0101 0000 0000 0000 0000 0000 0000 0000 */
- /* ~}| {zyx wvut srqp onml kjih gfed cba` */
- 0x80000000, /* 1000 0000 0000 0000 0000 0000 0000 0000 */
+ /* ~}| {zyx wvut srqp onml kjih gfed cba` */
+ 0xb8000001, /* 1011 1000 0000 0000 0000 0000 0000 0001 */
0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */