tarantool / nginx_upstream_module

Tarantool NginX upstream module (REST, JSON API, websockets, load balancing)
Other
174 stars 18 forks source link

Strange behavior during delete request without body #57

Closed Sulverus closed 8 years ago

Sulverus commented 8 years ago

Configuration:

if ( $request_method = GET ) {
    tnt_method "read";
}
if ( $request_method = PUT ) {
    tnt_method "insert";
}
if ( $request_method = POST ) {
    tnt_method "update";
}
if ( $request_method = DELETE ) {
    tnt_method "delete";
}
tnt_http_rest_methods get delete;
tnt_http_methods all;
tnt_multireturn_skip_count 2;
tnt_pure_result on;
tnt_pass_http_request on parse_args;
tnt_pass tnt;

Delete request with body:

delete /service/123
Body:
{"id": 0, "params": []}
Response:
200 - OK

Delete request without body:

delete /service/123
Response:
{'error': {'code': -32700, 'message': 'invalid json'}}

Probably it's a bug in tnt_http_rest_methods option

dedok commented 8 years ago

58