Welcome! Log In Create A New Profile

Advanced

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

Anonymous User
February 13, 2012 06:04AM
Author: vbart
Date: 2012-02-13 11:01:58 +0000 (Mon, 13 Feb 2012)
New Revision: 4465

Modified:
trunk/src/http/ngx_http_upstream.c
trunk/src/http/ngx_http_upstream.h
Log:
Upstream: added callback hook for the "Set-Cookie" header.

No functional changes.


Modified: trunk/src/http/ngx_http_upstream.c
===================================================================
--- trunk/src/http/ngx_http_upstream.c 2012-02-13 11:00:08 UTC (rev 4464)
+++ trunk/src/http/ngx_http_upstream.c 2012-02-13 11:01:58 UTC (rev 4465)
@@ -110,6 +110,8 @@
ngx_table_elt_t *h, ngx_uint_t offset);
static ngx_int_t ngx_http_upstream_rewrite_refresh(ngx_http_request_t *r,
ngx_table_elt_t *h, ngx_uint_t offset);
+static ngx_int_t ngx_http_upstream_rewrite_set_cookie(ngx_http_request_t *r,
+ ngx_table_elt_t *h, ngx_uint_t offset);
static ngx_int_t ngx_http_upstream_copy_allow_ranges(ngx_http_request_t *r,
ngx_table_elt_t *h, ngx_uint_t offset);

@@ -198,7 +200,7 @@

{ ngx_string("Set-Cookie"),
ngx_http_upstream_process_set_cookie, 0,
- ngx_http_upstream_copy_header_line, 0, 1 },
+ ngx_http_upstream_rewrite_set_cookie, 0, 1 },

{ ngx_string("Content-Disposition"),
ngx_http_upstream_ignore_header_line, 0,
@@ -3673,6 +3675,27 @@


static ngx_int_t
+ngx_http_upstream_rewrite_set_cookie(ngx_http_request_t *r, ngx_table_elt_t *h,
+ ngx_uint_t offset)
+{
+ ngx_table_elt_t *ho;
+
+ ho = ngx_list_push(&r->headers_out.headers);
+ if (ho == NULL) {
+ return NGX_ERROR;
+ }
+
+ *ho = *h;
+
+ if (r->upstream->rewrite_cookie) {
+ return r->upstream->rewrite_cookie(r, ho);
+ }
+
+ return NGX_OK;
+}
+
+
+static ngx_int_t
ngx_http_upstream_copy_allow_ranges(ngx_http_request_t *r,
ngx_table_elt_t *h, ngx_uint_t offset)
{

Modified: trunk/src/http/ngx_http_upstream.h
===================================================================
--- trunk/src/http/ngx_http_upstream.h 2012-02-13 11:00:08 UTC (rev 4464)
+++ trunk/src/http/ngx_http_upstream.h 2012-02-13 11:01:58 UTC (rev 4465)
@@ -299,6 +299,8 @@
ngx_int_t rc);
ngx_int_t (*rewrite_redirect)(ngx_http_request_t *r,
ngx_table_elt_t *h, size_t prefix);
+ ngx_int_t (*rewrite_cookie)(ngx_http_request_t *r,
+ ngx_table_elt_t *h);

ngx_msec_t timeout;


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

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

Anonymous User 1072 February 13, 2012 06:04AM



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

Online Users

Guests: 295
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