]> git.kaiwu.me - nginx.git/commitdiff
Perl: all known input headers are handled identically.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 30 May 2022 18:25:36 +0000 (21:25 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 30 May 2022 18:25:36 +0000 (21:25 +0300)
As all known input headers are now linked lists, these are now handled
identically.  In particular, this makes it possible to access properly
combined values of headers not specifically handled previously, such
as "Via" or "Connection".

src/http/modules/perl/nginx.xs

index e2180e6cfbfc341d3b951acd592498f4ab615abd..9e8a6a5ce07658d03837cceecb370a67be3ae5e9 100644 (file)
@@ -304,29 +304,11 @@ header_in(r, key)
 
         if (hh->offset == offsetof(ngx_http_headers_in_t, cookie)) {
             sep = ';';
-            goto multi;
-        }
-#if (NGX_HTTP_X_FORWARDED_FOR)
-        if (hh->offset == offsetof(ngx_http_headers_in_t, x_forwarded_for)) {
-            sep = ',';
-            goto multi;
-        }
-#endif
-
-        ph = (ngx_table_elt_t **) ((char *) &r->headers_in + hh->offset);
-
-        if (*ph) {
-            ngx_http_perl_set_targ((*ph)->value.data, (*ph)->value.len);
 
-            goto done;
+        } else {
+            sep = ',';
         }
 
-        XSRETURN_UNDEF;
-
-    multi:
-
-        /* Cookie, X-Forwarded-For */
-
         ph = (ngx_table_elt_t **) ((char *) &r->headers_in + hh->offset);
 
         if (*ph == NULL) {