Skip to content

Commit

Permalink
#120 fixed & add tests. Update (C) dates.
Browse files Browse the repository at this point in the history
  • Loading branch information
dedok committed Apr 15, 2019
1 parent 27836e4 commit 1a62080
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Copyright (C) 2015-2018 Tarantool AUTHORS:
* Copyright (C) 2015-2019 Tarantool AUTHORS:
* please see AUTHORS file.
*/

Expand Down
2 changes: 1 addition & 1 deletion src/json_encoders.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Copyright (C) 2016 - 2018 Tarantool AUTHORS:
* Copyright (C) 2016-2019 Tarantool AUTHORS:
* please see AUTHORS file.
*/

Expand Down
2 changes: 1 addition & 1 deletion src/json_encoders.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Copyright (C) 2016 - 2018 Tarantool AUTHORS:
* Copyright (C) 2016-2019 Tarantool AUTHORS:
* please see AUTHORS file.
*/

Expand Down
5 changes: 2 additions & 3 deletions src/ngx_http_tnt_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Copyright (C) 2015-2018 Tarantool AUTHORS:
* Copyright (C) 2015-2019 Tarantool AUTHORS:
* please see AUTHORS file.
*/


#include <ngx_core.h>
#include <ngx_http.h>
#include <ngx_config.h>
Expand Down Expand Up @@ -1616,7 +1615,7 @@ ngx_http_tnt_urldecode(ngx_http_request_t *r, ngx_str_t *src)

c = src->data[s++];

if (c == '%' && (ngx_uint_t) (s + 2) < src->len) {
if (c == '%' && (ngx_uint_t) (s + 2) <= src->len) {

u_char c2 = src->data[s++];
u_char c3 = src->data[s++];
Expand Down
4 changes: 2 additions & 2 deletions src/ngx_http_tnt_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Copyright (C) 2015-2018 Tarantool AUTHORS:
* Copyright (C) 2015-2019 Tarantool AUTHORS:
* please see AUTHORS file.
*/

#ifndef NGX_HTTP_TNT_VERSION_H
#define NGX_HTTP_TNT_VERSION_H 1

#define NGX_HTTP_TNT_MODULE_VERSION_STRING "v2.7"
#define NGX_HTTP_TNT_MODULE_VERSION_STRING "v2.7.1"

#endif
2 changes: 1 addition & 1 deletion src/ngx_http_tnt_version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Copyright (C) 2015-2018 Tarantool AUTHORS:
* Copyright (C) 2015-2019 Tarantool AUTHORS:
* please see AUTHORS file.
*/

Expand Down
2 changes: 1 addition & 1 deletion src/tp_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Copyright (C) 2015-2018 Tarantool AUTHORS:
* Copyright (C) 2015-2019 Tarantool AUTHORS:
* please see AUTHORS file.
*/

Expand Down
2 changes: 1 addition & 1 deletion src/tp_transcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Copyright (C) 2015-2018 Tarantool AUTHORS:
* Copyright (C) 2015-2019 Tarantool AUTHORS:
* please see AUTHORS file.
*/

Expand Down
2 changes: 1 addition & 1 deletion src/tp_transcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Copyright (C) 2015-2018 Tarantool AUTHORS:
* Copyright (C) 2015-2019 Tarantool AUTHORS:
* please see AUTHORS file.
*/

Expand Down
8 changes: 7 additions & 1 deletion t/ngx_confs/tnt_server_test.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

http {

autoindex off;
access_log off;

include mime.types;
default_type application/octet-stream;
Expand Down Expand Up @@ -455,5 +455,11 @@ http {
}
tnt_pass tnt;
}
location /issue_120 {
tnt_pass_http_request on parse_args unescape;
tnt_http_rest_methods all;
tnt_http_methods all;
tnt_pass tnt;
}
}
}
7 changes: 6 additions & 1 deletion t/run_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ for i in {1..10}; do
$WORK_DIR/v26_features.py 1> /dev/null || (
echo "[-] $WORK_DIR/v26_features.py failed" && exit 1
)
$WORK_DIR/v27_features.py 1> /dev/null || (
echo "[-] $WORK_DIR/v26_features.py failed" && exit 1
)
done
echo '[+] OK'

Expand Down Expand Up @@ -64,7 +67,9 @@ for i in {1..3}; do
#$WORK_DIR/v26_features.py 1> /dev/null || (
# echo "[-] $WORK_DIR/v26_features.py failed" && exit 1
# )

$WORK_DIR/v27_features.py 1> /dev/null || (
echo "[-] $WORK_DIR/v26_features.py failed" && exit 1
)
clients_pids="$clients_pids $!"
done
for job in $clients_pids; do
Expand Down
4 changes: 4 additions & 0 deletions t/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ function issue_108(req)
return req
end

function issue_120(request)
return request
end

-- CFG
box.cfg {
log_level = 5,
Expand Down
22 changes: 22 additions & 0 deletions t/v27_features.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/python
# -_- encoding: utf8 -_-

import sys
import time
sys.path.append('./t')
from http_utils import *

please_unescape_it = BASE_URL + '/issue_120/'

print ('[+] unescape regression test')
args = {'arg1': 1, 'arg2': 'somestring'}
result = get_success(please_unescape_it + '19UM|SMSO/a%7Cx%3Db', args, {})
assert(result['uri'] == '/issue_120/19UM|SMSO/a|x=b?arg1=1&arg2=somestring'), \
"expected result"
print ('[+] OK')

print ('[+] issue 120')
result = get_success(please_unescape_it + '%7B%7D', {}, {})
assert(result['uri'] == '/issue_120/{}'), "expected result"
print ('[+] OK')

0 comments on commit 1a62080

Please sign in to comment.