From f1b59814f8da2f3e235d47adfb332edf8a093b31 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Fri, 26 Dec 2003 00:17:55 +0000 Subject: [project @ 2003-12-26 00:17:55 by bursa] New url_join using liburi, . svn path=/import/netsurf/; revision=441 --- content/fetch.c | 5 +++++ content/fetchcache.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'content') diff --git a/content/fetch.c b/content/fetch.c index f03cfc615..f7197a7aa 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -602,6 +602,11 @@ bool fetch_process_headers(struct fetch *f) url_path = curl_unescape(f->url + 8, (int) strlen(f->url) - 8); 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); + type = fetch_filetype(url_path); + curl_free(url_path); } } diff --git a/content/fetchcache.c b/content/fetchcache.c index 28c098034..63bd5be35 100644 --- a/content/fetchcache.c +++ b/content/fetchcache.c @@ -147,8 +147,12 @@ void fetchcache_callback(fetch_msg msg, void *p, char *data, unsigned long size) /* redirect URLs must be absolute by HTTP/1.1, but many sites send * relative ones: treat them as relative to requested URL */ url = url_join(data, c->url); - content_broadcast(c, CONTENT_MSG_REDIRECT, url); - xfree(url); + if (url) { + content_broadcast(c, CONTENT_MSG_REDIRECT, url); + xfree(url); + } else { + content_broadcast(c, CONTENT_MSG_ERROR, "Bad redirect"); + } if (c->cache) cache_destroy(c); content_destroy(c); -- cgit v1.2.3