[multiple] use preferred syntax for Content-Type

use preferred syntax for Content-Type: .../charset=...
(match preferred syntax specified in upcoming HTTP spec revision)
master
Glenn Strauss 7 months ago
parent dbfee2a299
commit 85b5988dc7
  1. 4
      doc/scripts/create-mime.conf.pl
  2. 2
      src/mod_dirlisting.c
  3. 6
      src/mod_webdav.c

@ -9,7 +9,7 @@ use strict;
my $verbose = 0;
foreach (@ARGV) { $verbose = 1 if ($_ eq "-v"); }
# text/* subtypes to serve as "text/...; charset=utf-8"
# text/* subtypes to serve as "text/...;charset=utf-8"
# text/html IS NOT INCLUDED: html has its own method for defining charset
# (<meta>), but the standards specify that content-type in HTTP wins over
# the setting in the html document.
@ -147,7 +147,7 @@ sub add {
sub print_type {
my ($extension, $mimetype) = @_;
if ($mimetype =~ /^text\/(.*)$/) {
$mimetype .= "; charset=utf-8" if $text_utf8{$1};
$mimetype .= ";charset=utf-8" if $text_utf8{$1};
}
print "\t\"${extension}\" => \"${mimetype}\",\n";

@ -1260,7 +1260,7 @@ static void mod_dirlisting_content_type (request_st * const r, const buffer * co
if (NULL == encoding)
buffer_copy_string_len(vb, CONST_STR_LEN("text/html"));
else
buffer_append_str2(vb, CONST_STR_LEN("text/html; charset="),
buffer_append_str2(vb, CONST_STR_LEN("text/html;charset="),
BUF_PTR_LEN(encoding));
}

@ -794,7 +794,7 @@ webdav_xml_doctype (buffer * const b, request_st * const r)
{
http_header_response_set(r, HTTP_HEADER_CONTENT_TYPE,
CONST_STR_LEN("Content-Type"),
CONST_STR_LEN("application/xml; charset=\"utf-8\""));
CONST_STR_LEN("application/xml;charset=utf-8"));
buffer_copy_string_len(b, CONST_STR_LEN(
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"));
@ -3432,7 +3432,7 @@ webdav_propfind_live_props (const webdav_propfind_bufs * const restrict pb,
* in [RFC2616], Section 4.2. Server implementors SHOULD strip
* LWS from these values before using as WebDAV property
* values.
* e.g. application/xml;charset="utf-8"
* e.g. application/xml;charset=utf-8
* instead of: application/xml; charset="utf-8"
* (documentation-only; no check is done here to remove LWS)
*/
@ -5598,7 +5598,7 @@ mod_webdav_lock (request_st * const r, const plugin_config * const pconf)
* Accept: * / *\r\n
* Depth: 0\r\n
* Timeout: Second-600\r\n
* Content-Type: text/xml; charset=\"utf-8\"\r\n
* Content-Type: text/xml;charset=utf-8\r\n
* Content-Length: 229\r\n
* Connection: keep-alive\r\n
* Host: 192.168.178.23:1025\r\n

Loading…
Cancel
Save