summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGES3
-rw-r--r--modules/http/http_filters.c16
2 files changed, 17 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 9fd0565925..4af62a1805 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
Changes with Apache 2.3.0
[ When backported to 2.2.x, remove entry from this file ]
+ *) Don't add bogus duplicate Content-Language entries
+ PR 11035 [Davi Arnaut]
+
*) mod_proxy_ftp: Fix base for directory listings.
PR 27834 [Nick Kew]
diff --git a/modules/http/http_filters.c b/modules/http/http_filters.c
index d3fa5f1c0c..ac6f5b1ad9 100644
--- a/modules/http/http_filters.c
+++ b/modules/http/http_filters.c
@@ -1173,10 +1173,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);
}
/*