diff options
author | Valentin Bartenev <vbart@nginx.com> | 2020-03-27 17:22:52 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2020-03-27 17:22:52 +0300 |
commit | d4b4cb0438d753e7694f8f76c41207bbe01fe790 (patch) | |
tree | 96a19d74ec96370aae0b57100592d3892b87d705 /src | |
parent | 8d727774e3a2b2eaf194781c382fb953ed61f755 (diff) | |
download | unit-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 '')
-rw-r--r-- | src/nxt_string.c | 10 |
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 */ |