Skip to content

Commit 8ed9781

Browse files
committed
Add content type to filtered header in apache2
1 parent d0602e0 commit 8ed9781

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: src/redirectionio_protocol.c

+14
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,20 @@ apr_status_t redirectionio_protocol_send_filter_headers(redirectionio_context *c
237237
first_header = current_header;
238238
}
239239

240+
if (r->content_type) {
241+
current_header = (struct REDIRECTIONIO_HeaderMap *) apr_palloc(r->pool, sizeof(struct REDIRECTIONIO_HeaderMap));
242+
243+
if (current_header == NULL) {
244+
return APR_EGENERAL;
245+
}
246+
247+
current_header->name = (const char *)"Content-Type";
248+
current_header->value = (const char *)r->content_type;
249+
current_header->next = first_header;
250+
251+
first_header = current_header;
252+
}
253+
240254
first_header = (struct REDIRECTIONIO_HeaderMap *)redirectionio_action_header_filter_filter(ctx->action, first_header, r->status, config->show_rule_ids == 1);
241255
ctx->response_headers = first_header;
242256

0 commit comments

Comments
 (0)