summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2006-01-03 17:01:17 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2006-01-03 17:01:17 +0000
commit05bb6641e1e268943f795be2db5e9c46382ea189 (patch)
tree78f479f15e9eddbe311f768542e7f1f19522916c /content
parent3b2ec218a75558f4da8f52f03c7ece0bb1bff555 (diff)
downloadnetsurf-05bb6641e1e268943f795be2db5e9c46382ea189.tar.gz
netsurf-05bb6641e1e268943f795be2db5e9c46382ea189.tar.bz2
[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
Diffstat (limited to 'content')
-rw-r--r--content/fetch.c11
1 files 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);
}