Browse Source

Overwrite Content-Type header in mod_dirlisting instead of inserting (#1614), patch by Henrik Holst

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2152 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.20
Stefan Bühler 14 years ago
parent
commit
4bf89c62b6
  1. 1
      NEWS
  2. 4
      src/mod_dirlisting.c

1
NEWS

@ -17,6 +17,7 @@ NEWS
* Enable escaping of % and $ in redirect/rewrite; only two cases changed their behaviour: "%%" => "%", "$$" => "$"
* Fix accesslog port (should be port from the connection, not the "server.port") (#1618)
* Fix mod_fastcgi prefix matching: match the prefix always against url, not the absolute filepath (regardless of check-local)
* Overwrite Content-Type header in mod_dirlisting instead of inserting (#1614), patch by Henrik Holst
- 1.4.19 - 2008-03-10

4
src/mod_dirlisting.c

@ -841,11 +841,11 @@ static int http_list_directory(server *srv, connection *con, plugin_data *p, buf
/* Insert possible charset to Content-Type */
if (buffer_is_empty(p->conf.encoding)) {
response_header_insert(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/html"));
response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/html"));
} else {
buffer_copy_string(p->content_charset, "text/html; charset=");
buffer_append_string_buffer(p->content_charset, p->conf.encoding);
response_header_insert(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(p->content_charset));
response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(p->content_charset));
}
con->file_finished = 1;

Loading…
Cancel
Save