Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4651 - trunk/src/http

Anonymous User
May 30, 2012 08:32AM
Author: vbart
Date: 2012-05-30 12:30:03 +0000 (Wed, 30 May 2012)
New Revision: 4651
URL: http://trac.nginx.org/nginx/changeset/4651/nginx

Log:
Fixed returned value handling from the cookie rewrite handler.

If the "proxy_cookie_domain" or "proxy_cookie_path" directive is used and there
are no matches in Set-Cookie header then ngx_http_proxy_rewrite_cookie() returns
NGX_DECLINED to indicate that the header was not rewritten. Returning this value
further from the upstream headers copy handler resulted in 500 error response.

See here for report:
http://mailman.nginx.org/pipermail/nginx/2012-May/033858.html


Modified:
trunk/src/http/ngx_http_upstream.c

Modified: trunk/src/http/ngx_http_upstream.c
===================================================================
--- trunk/src/http/ngx_http_upstream.c 2012-05-29 09:19:51 UTC (rev 4650)
+++ trunk/src/http/ngx_http_upstream.c 2012-05-30 12:30:03 UTC (rev 4651)
@@ -3677,6 +3677,7 @@
ngx_http_upstream_rewrite_set_cookie(ngx_http_request_t *r, ngx_table_elt_t *h,
ngx_uint_t offset)
{
+ ngx_int_t rc;
ngx_table_elt_t *ho;

ho = ngx_list_push(&r->headers_out.headers);
@@ -3687,7 +3688,20 @@
*ho = *h;

if (r->upstream->rewrite_cookie) {
- return r->upstream->rewrite_cookie(r, ho);
+ rc = r->upstream->rewrite_cookie(r, ho);
+
+ if (rc == NGX_DECLINED) {
+ return NGX_OK;
+ }
+
+#if (NGX_DEBUG)
+ if (rc == NGX_OK) {
+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+ "rewritten cookie: \"%V\"", &ho->value);
+ }
+#endif
+
+ return rc;
}

return NGX_OK;

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r4651 - trunk/src/http

Anonymous User 1059 May 30, 2012 08:32AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 314
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready