From 05bb6641e1e268943f795be2db5e9c46382ea189 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Tue, 3 Jan 2006 17:01:17 +0000 Subject: [project @ 2006-01-03 17:01:17 by jmb] Fix 1371902. fetch_filetype now receives the unix path with the leading / (which it always should have done, tbh). svn path=/import/netsurf/; revision=1976 --- content/fetch.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/content/fetch.c b/content/fetch.c index b80cb4f16..c83e6e9f8 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -326,6 +326,13 @@ struct fetch * fetch_start(char *url, char *referer, s[sizeof s - 1] = 0; APPEND(fetch->headers, s); } + /* Ensure that the Host header is set */ + { + char s[80]; + snprintf(s, sizeof s, "Host: %s", host); + s[sizeof s - 1] = 0; + APPEND(fetch->headers, s); + } /* look for a fetch from the same host */ for (host_fetch = fetch_list; @@ -821,12 +828,12 @@ bool fetch_process_headers(struct fetch *f) type = "text/html"; if (strncmp(f->url, "file:///", 8) == 0) { char *url_path; - url_path = curl_unescape(f->url + 8, (int) strlen(f->url) - 8); + url_path = curl_unescape(f->url + 7, (int) strlen(f->url) - 7); type = fetch_filetype(url_path); curl_free(url_path); } else if (strncmp(f->url, "file:/", 6) == 0) { char *url_path; - url_path = curl_unescape(f->url + 6, (int) strlen(f->url) - 6); + url_path = curl_unescape(f->url + 5, (int) strlen(f->url) - 5); type = fetch_filetype(url_path); curl_free(url_path); } -- cgit v1.2.3