diff --git a/src/ngx_http_echo_handler.c b/src/ngx_http_echo_handler.c index ef2676f..a2b15e1 100644 --- a/src/ngx_http_echo_handler.c +++ b/src/ngx_http_echo_handler.c @@ -229,7 +229,14 @@ ngx_http_echo_run_cmds(ngx_http_request_t *r) case echo_opcode_echo_exec: rc = ngx_http_echo_exec_exec(r, ctx, computed_args); - goto done; + +#if defined(nginx_version) && nginx_version >= 8011 + if (rc == NGX_DONE) { + r->main->count--; + } +#endif + + return rc; break; default: diff --git a/test/t/echo-before-body.t b/test/t/echo-before-body.t index d9b81c9..c562c6c 100644 --- a/test/t/echo-before-body.t +++ b/test/t/echo-before-body.t @@ -157,6 +157,7 @@ status: 404 ^status: 403.*?status: 500.*$ + === TEST 10: echo -n --- config location /echo { diff --git a/test/t/exec.t b/test/t/exec.t index 4b9beb3..80753aa 100644 --- a/test/t/exec.t +++ b/test/t/exec.t @@ -106,3 +106,28 @@ a: [] --- response_body uri: [/foo] + + +=== TEST 7: query string ignored for named locations +--- config + location /entry { + echo_location /foo; + echo_sleep 0.001; + echo_location /foo; + } + location /foo { + echo_exec @bar; + } + location @bar { + proxy_pass http://127.0.0.1:$server_port/bar; + } + location /bar { + echo_sleep 0.01; + echo hello; + } +--- request + GET /entry +--- response_body +hello +hello +