/*
* Builds the content-type that should be sent to the client from the
* content-type specified. The following rules are followed:
- * - if type is NULL, type is set to ap_default_type(r)
+ * - if type is NULL or "", return NULL (do not set content-type).
* - if charset adding is disabled, stop processing and return type.
* - then, if there are no parameters on type, add the default charset
* - return type
core_request_config *request_conf;
apr_size_t type_len;
- if (!type) {
- type = ap_default_type(r);
+ if (!type || *type == '\0') {
+ return NULL;
}
if (conf->add_default_charset != ADD_DEFAULT_CHARSET_ON) {
r->uri = r->parsed_uri.path ? r->parsed_uri.path
: apr_pstrdup(r->pool, "/");
-#if defined(OS2) || defined(WIN32)
- /* Handle path translations for OS/2 and plug security hole.
+#if defined(WIN32)
+ /* Handle path translations and plug security hole.
* This will prevent "http://www.wherever.com/..\..\/" from
* returning a directory for the root drive.
*/
for (x = r->uri; (x = strchr(x, '\\')) != NULL; )
*x = '/';
}
-#endif /* OS2 || WIN32 */
+#endif /* WIN32 */
}
else {
r->args = NULL;
apr_table_do(send_header, &x, r->headers_out, NULL);
apr_table_clear(r->headers_out);
}
- ap_fputs(x.f, x.bb, CRLF);
+ ap_fputs(x.f, x.bb, CRLF_ASCII);
ap_fflush(x.f, x.bb);
apr_brigade_destroy(x.bb);
}