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