Blame content-type.patch

ad64c07
commit 040a1ae5cb2aab38b2bc716cc3d0d6fa7b998a7a
ad64c07
Author: John Dennis <jdennis@redhat.com>
ad64c07
Date:   Mon Jan 16 09:02:06 2017 -0500
ad64c07
ad64c07
    Use ap_set_content_type() to set "Content-Type" header
ad64c07
    
ad64c07
    Formerly we were setting the response header "Content-Type" in
ad64c07
    r->headers_out directly via the apr_table_setn() call. Although using
ad64c07
    apr_table_setn() is appropriate for many HTTP headers Apache actively
ad64c07
    manages a small set of headers in
ad64c07
    http_filters.c:ap_http_header_filter(). These managed headers are
ad64c07
    derived from values maintained in the request_rec. "Content-Type" is
ad64c07
    one of the managed headers.
ad64c07
    
ad64c07
    Because we didn't set r->content_type field via the
ad64c07
    ap_set_content_type() call and instead directly updated the
ad64c07
    r->headers_out table our value for "Content-Type" was overwriten when
ad64c07
    the ap_http_header_filter() was run just prior to emitting the
ad64c07
    response with the result the "Content-Type" header returned to the
ad64c07
    client was incorrect.
ad64c07
    
ad64c07
    Signed-off-by: John Dennis <jdennis@redhat.com>
ad64c07
ad64c07
diff --git a/auth_mellon_handler.c b/auth_mellon_handler.c
ad64c07
index a55828a..25365de 100644
ad64c07
--- a/auth_mellon_handler.c
ad64c07
+++ b/auth_mellon_handler.c
ad64c07
@@ -2655,7 +2655,7 @@ static int am_set_authn_request_post_content(request_rec *r, LassoLogin *login)
ad64c07
  */
ad64c07
 static int am_set_authn_request_paos_content(request_rec *r, LassoLogin *login)
ad64c07
 {
ad64c07
-    apr_table_setn(r->headers_out, "Content-Type", MEDIA_TYPE_PAOS);
ad64c07
+    ap_set_content_type(r, MEDIA_TYPE_PAOS);
ad64c07
     ap_rputs(LASSO_PROFILE(login)->msg_body, r);
ad64c07
 
ad64c07
     return OK;