Changes with Apache 2.3.0
[ When backported to 2.2.x, remove entry from this file ]
+ *) HTTP protocol: Add "DefaultType none" option.
+ PR 13986 and PR 16139 [Nick Kew]
+
*) mod_proxy_ajp: Ignore any ajp13 flush packets received before
we send the response headers. See Tomcat PR 43478.
[Jim Jagielski]
#define DEFAULT_CONTENT_TYPE "text/plain"
#endif
+/**
+ * NO_CONTENT_TYPE is an alternative DefaultType value that suppresses
+ * setting any default type when there's no information (e.g. a proxy).
+ */
+#ifndef NO_CONTENT_TYPE
+#define NO_CONTENT_TYPE "none"
+#endif
+
/** The name of the MIME types file */
#ifndef AP_TYPES_CONFIG_FILE
#define AP_TYPES_CONFIG_FILE "conf/mime.types"
"byteranges; boundary=",
ctx->boundary, NULL));
- ctx->bound_head = apr_pstrcat(r->pool,
- CRLF "--", ctx->boundary,
- CRLF "Content-type: ",
- orig_ct,
- CRLF "Content-range: bytes ",
- NULL);
+ if (strcasecmp(orig_ct, NO_CONTENT_TYPE)) {
+ ctx->bound_head = apr_pstrcat(r->pool,
+ CRLF "--", ctx->boundary,
+ CRLF "Content-type: ",
+ orig_ct,
+ CRLF "Content-range: bytes ",
+ NULL);
+ }
+ else {
+ /* if we have no type for the content, do our best */
+ ctx->bound_head = apr_pstrcat(r->pool,
+ CRLF "--", ctx->boundary,
+ CRLF "Content-range: bytes ",
+ NULL);
+ }
ap_xlate_proto_to_ascii(ctx->bound_head, strlen(ctx->bound_head));
}
apr_bucket_brigade *b2;
header_struct h;
header_filter_ctx *ctx = f->ctx;
+ const char *ctype;
AP_DEBUG_ASSERT(!r->main);
apr_table_unset(r->headers_out, "Content-Length");
}
- apr_table_setn(r->headers_out, "Content-Type",
- ap_make_content_type(r, r->content_type));
+ ctype = ap_make_content_type(r, r->content_type);
+ if (strcasecmp(ctype, NO_CONTENT_TYPE)) {
+ apr_table_setn(r->headers_out, "Content-Type", ctype);
+ }
if (r->content_encoding) {
apr_table_setn(r->headers_out, "Content-Encoding",