summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_script.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2011-11-01Merging r4147, r4148, r4149, r4150, r4207:Igor Sysoev1-0/+2
Fixes of combination of error_page and return directives: *) Fix for incorrect 201 replies from dav module. Replies with 201 code contain body, and we should clearly indicate it's empty if it's empty. Before 0.8.32 chunked was explicitly disabled for 201 replies and as a result empty body was indicated by connection close (not perfect, but worked). Since 0.8.32 chunked is enabled, and this causes incorrect responses from dav module when HTTP/1.1 is used: with "Transfer-Encoding: chunked" but no chunks at all. Fix is to actually return empty body in special response handler instead of abusing r->header_only flag. See here for initial report: http://mailman.nginx.org/pipermail/nginx-ru/2010-October/037535.html *) Fix for double content when return is used in error_page handler. Test case: location / { error_page 405 /nope; return 405; } location /nope { return 200; } This is expected to return 405 with empty body, but in 0.8.42+ will return builtin 405 error page as well (though not counted in Content-Length, thus breaking protocol). Fix is to use status provided by rewrite script execution in case it's less than NGX_HTTP_BAD_REQUEST even if r->error_status set. This check is in line with one in ngx_http_script_return_code(). Note that this patch also changes behaviour for "return 302 ..." and "rewrite ... redirect" used as error handler. E.g. location / { error_page 405 /redirect; return 405; } location /redirect { rewrite ^ http://example.com/; } will actually return redirect to "http://example.com/" instead of builtin 405 error page with meaningless Location header. This looks like correct change and it's in line with what happens on e.g. directory redirects in error handlers. *) Fix for "return 202" not discarding body. Big POST (not fully preread) to a location / { return 202; } resulted in incorrect behaviour due to "return" code path not calling ngx_http_discard_request_body(). The same applies to all "return" used with 2xx/3xx codes except 201 and 204, and to all "return ... text" uses. Fix is to add ngx_http_discard_request_body() call to ngx_http_send_response() function where it looks appropriate. Discard body call from emtpy gif module removed as it's now redundant. Reported by Pyry Hakulinen, see http://mailman.nginx.org/pipermail/nginx/2011-August/028503.html *) Incorrect special case for "return 204" removed. The special case in question leads to replies without body in configuration like location / { error_page 404 /zero; return 404; } location /zero { return 204; } while replies with empty body are expected per protocol specs. Correct one will look like if (status == NGX_HTTP_NO_CONTENT) { rc = ngx_http_send_header(r); if (rc == NGX_ERROR || r->header_only) { return rc; } return ngx_http_send_special(r, NGX_HTTP_LAST); } though it looks like it's better to drop this special case at all. *) Clear old Location header (if any) while adding a new one. This prevents incorrect behaviour when another redirect is issued within error_page 302 handler.
2011-05-03test zero value in an "if" directive consistently with predicates fixed in r3894Igor Sysoev1-1/+1
thanks to Maxim Dounin
2011-04-15values starting with '0' were incorrectly assumed to be falseIgor Sysoev1-1/+1
patch by Maxim Dounin
2011-04-12use memmove() in appropriate placesIgor Sysoev1-1/+1
2010-09-13fix typoIgor Sysoev1-1/+1
2010-09-02new ngx_http_secure_link_module with secure_link, secure_link_md5, andIgor Sysoev1-0/+36
secure_link_expires
2010-07-14ngx_http_test_predicates(), ngx_http_set_predicate_slot()Igor Sysoev1-0/+70
2010-06-18return code textIgor Sysoev1-6/+9
2010-05-14ngx_str_set() and ngx_str_null()Igor Sysoev1-2/+1
2009-11-16fix captures in "rewrite", the bug had been introduced in r3326Igor Sysoev1-3/+3
2009-11-16regex named capturesIgor Sysoev1-23/+3
2009-09-30read_aheadIgor Sysoev1-0/+1
2009-09-25low ENAMETOOLONG logging levelIgor Sysoev1-1/+4
2009-07-14ngx_http_set_exten() is always successful since 0.3.46Igor Sysoev1-5/+1
2009-06-02fix return value on failureIgor Sysoev1-1/+1
2009-04-27-p and --prefix=Igor Sysoev1-4/+5
2009-04-27*) of.test_only to not open file if only stat() is enoughIgor Sysoev1-1/+2
*) of.failed to return exact name of failed syscall
2009-03-27rename ngx_http_scrip_flush_complex_value()Igor Sysoev1-2/+2
to ngx_http_script_flush_complex_value()
2009-03-27fix plain text values using relative path in ngx_http_complex_value(),Igor Sysoev1-5/+5
this fixes the auth_basic_user_file bug introduced in r2589
2009-03-22ngx_http_script_flush_complex_value()Igor Sysoev1-10/+293
ngx_http_complex_value() ngx_http_compile_complex_value()
2009-03-18split ngx_http_script_compile()Igor Sysoev1-159/+234
2009-03-06now regex captures are per-request entitiesIgor Sysoev1-68/+102
2009-02-10fix /?new=arg?old=arg redirect caseIgor Sysoev1-4/+15
2008-12-11fix r2394Igor Sysoev1-14/+4
2008-12-10fix debug loggingIgor Sysoev1-17/+46
2008-09-01escape a query string characters taken from URI while rewriteIgor Sysoev1-0/+1
2008-07-31fix conflicting names "true" and "false"Igor Sysoev1-21/+21
2008-07-30directioIgor Sysoev1-0/+1
2008-06-26ngx_memzero() ngx_open_file_info_tIgor Sysoev1-2/+2
2008-06-23initialize of.uniq in ngx_open_cached_file()Igor Sysoev1-0/+1
2008-06-17*) back out r2040Igor Sysoev1-3/+3
*) refactor ngx_palloc() *) introduce ngx_pnalloc() *) additional pool blocks have smaller header
2008-02-12length calculation did not take into account escaped symbols in argumentsIgor Sysoev1-3/+22
2007-12-27optimizationIgor Sysoev1-1/+1
2007-12-22open_file_cache_min_usesIgor Sysoev1-0/+1
2007-12-21open_file_cache_retest > open_file_cache_validIgor Sysoev1-1/+1
2007-10-22unescape SSI includeIgor Sysoev1-1/+2
2007-10-14fix English grammarIgor Sysoev1-4/+4
2007-10-09%v fix lost in r1407Igor Sysoev1-1/+1
2007-09-03open_file_cache_eventsIgor Sysoev1-0/+1
2007-09-01open_file_cache in HTTPIgor Sysoev1-29/+30
2007-08-20use %v for ngx_variable_value_t in ngx_sprintf(),Igor Sysoev1-1/+1
this fixes nginx on FreeBSD/sparc64
2007-03-30flush nocachable variables before ngx_http_script_run()Igor Sysoev1-3/+14
2006-11-14debug log should not be under rewrite_log controlIgor Sysoev1-9/+5
2006-10-02set "Content-Length: 0" for errors handled by "return 204"Igor Sysoev1-0/+1
2006-08-28nginx-0.3.61-RELEASE importrelease-0.3.61Igor Sysoev1-0/+2
*) Change: now the "tcp_nodelay" directive is turned on by default. *) Feature: the "msie_refresh" directive. *) Feature: the "recursive_error_pages" directive. *) Bugfix: the "rewrite" directive returned incorrect redirect, if the redirect had the captured escaped symbols from original URI.
2006-08-14nginx-0.3.58-RELEASE importrelease-0.3.58Igor Sysoev1-0/+4
*) Feature: the "error_page" directive supports the variables. *) Change: now the procfs interface instead of sysctl is used on Linux. *) Change: now the "Content-Type" header line is inherited from first response when the "X-Accel-Redirect" was used. *) Bugfix: the "error_page" directive did not redirect the 413 error. *) Bugfix: the trailing "?" did not remove old arguments if no new arguments were added to a rewritten URI. *) Bugfix: nginx could not run on 64-bit FreeBSD 7.0-CURRENT.
2006-08-09nginx-0.3.57-RELEASE importrelease-0.3.57Igor Sysoev1-0/+3
*) Feature: the $ssl_client_serial variable. *) Bugfix: in the "!-e" operator of the "if" directive. Thanks to Andrian Budanstov. *) Bugfix: while a client certificate verification nginx did not send to a client the required certificates information. *) Bugfix: the $document_root variable did not support the variables in the "root" directive.
2006-08-04nginx-0.3.56-RELEASE importrelease-0.3.56Igor Sysoev1-0/+53
*) Feature: the "dav_access" directive. *) Feature: the "if" directive supports the "-d", "!-d", "-e", "!-e", "-x", and "!-x" operators. *) Bugfix: a segmentation fault occurred if a request returned a redirect and some sent to client header lines were logged in the access log.
2006-05-31nginx-0.3.49-RELEASE importrelease-0.3.49Igor Sysoev1-1/+3
*) Bugfix: in the "set" directive. *) Bugfix: if two or more FastCGI subrequests was in SSI, then first subrequest output was included instead of second and following subrequests.
2006-05-29nginx-0.3.48-RELEASE importrelease-0.3.48Igor Sysoev1-0/+4
*) Change: now the ngx_http_charset_module works for subrequests, if the response has no "Content-Type" header line. *) Bugfix: if the "proxy_pass" directive has no URI part, then the "proxy_redirect default" directive add the unnecessary slash in start of the rewritten redirect. *) Bugfix: the internal redirect always transform client's HTTP method to GET, now the transformation is made for the "X-Accel-Redirect" redirects only and if the method is not HEAD; the bug had appeared in 0.3.42. *) Bugfix: the ngx_http_perl_module could not be built, if the perl was built with the threads support; the bug had appeared in 0.3.46.