1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-27 01:25:34 +00:00

[xml] Do not override all headers

I have no better idea how to preserve headers and set utf-8.
This commit is contained in:
Witold Filipczyk 2021-08-07 20:45:59 +02:00
parent f56b953d4b
commit a5c6adb7db

View File

@ -287,7 +287,18 @@ render_xhtml_document(struct cache_entry *cached, struct document *document, str
if (!init_string(&head)) return;
add_to_string(&head, "\r\nContent-Type: text/html; charset=utf-8\r\n");
bool add_to_head = true;
if (cached->head) {
if (!strncmp(cached->head, "\r\nContent-Type: text/html; charset=utf-8\r\n",
sizeof("\r\nContent-Type: text/html; charset=utf-8\r\n") - 1)) {
add_to_head = false;
}
}
if (add_to_head) {
add_to_string(&head, "\r\nContent-Type: text/html; charset=utf-8\r\n");
if (cached->head) add_to_string(&head, cached->head);
}
xmlpp::Document *doc = document->dom;