]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r611475 from trunk:
authorJim Jagielski <jim@apache.org>
Tue, 26 Feb 2008 19:52:29 +0000 (19:52 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 26 Feb 2008 19:52:29 +0000 (19:52 +0000)
Don't add bogus duplicate Content-Language header entries.
PR 11035

Submitted by: niq
Reviewed by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@631363 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/http/http_filters.c

diff --git a/CHANGES b/CHANGES
index d1fd278f809ed5f313cb4cb1d9e2ac543bb28208..74418d2447cc663dd17b74f1efbf1ea07495e65a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.2.9
 
+  *) Don't add bogus duplicate Content-Language entries
+     PR 11035 [Davi Arnaut]
+
   *) Worker / Event MPM: Fix race condition in pool recycling that leads to
      segmentation faults under load.  PR 44402
      [Basant Kumar Kukreja <basant.kukreja sun.com>]
diff --git a/STATUS b/STATUS
index 7166a445bfd93a7b47d4dad189a87b080cb143ea..0df45183c4889449e083cfc6e383d41c94b71577 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -81,11 +81,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
- * Don't add bogus duplicate Content-Language entries to generated output
-   PR 11035
-   http://svn.apache.org/viewvc?rev=611475&view=rev
-   +1: niq, rpluem, jim
-
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
 
index 9ab3e5d66c79145281c306f37117381a505281f2..83e2f784261ac0d0755db7a284ddcdfc938514b4 100644 (file)
@@ -1174,10 +1174,22 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f,
 
     if (!apr_is_empty_array(r->content_languages)) {
         int i;
+        char *token;
         char **languages = (char **)(r->content_languages->elts);
-        for (i = 0; i < r->content_languages->nelts; ++i) {
-            apr_table_mergen(r->headers_out, "Content-Language", languages[i]);
+        const char *field = apr_table_get(r->headers_out, "Content-Language");
+
+        while (field && (token = ap_get_list_item(r->pool, &field)) != NULL) {
+            for (i = 0; i < r->content_languages->nelts; ++i) {
+                if (!strcasecmp(token, languages[i]))
+                    break;
+            }
+            if (i == r->content_languages->nelts) {
+                *((char **) apr_array_push(r->content_languages)) = token;
+            }
         }
+
+        field = apr_array_pstrcat(r->pool, r->content_languages, ',');
+        apr_table_setn(r->headers_out, "Content-Language", field);
     }
 
     /*