aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle J. McKay <mackyle@gmail.com>2017-08-23 18:48:38 +0000
committerKyle J. McKay <mackyle@gmail.com>2017-08-23 18:48:38 +0000
commitd398b4033239448169d851e099bef76cb8e46054 (patch)
tree25e99809aa65cd347201d2f19e68135ab150724e
parentUpdate ChangeLog (diff)
downloadw3m-d398b4033239448169d851e099bef76cb8e46054.tar.gz
w3m-d398b4033239448169d851e099bef76cb8e46054.zip
file.c: compute correct base URL when not absolute
When a server makes use of the PATH_INFO feature in a CGI, the returned pages may often have a <base href="..." /> tag specifying the URL of the CGI itself as the base. However, to avoid hard-coding the scheme and host into such a base href, the href value will often omit the scheme, host and port. Make sure that when parsing any such base href value that any omitted components are taken from the current URL rather than taken as being from a bare, absolute file:/// URL. Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Diffstat (limited to '')
-rw-r--r--file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/file.c b/file.c
index 4d15ff1..9b0e947 100644
--- a/file.c
+++ b/file.c
@@ -5993,7 +5993,7 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
buf->document_charset);
if (!buf->baseURL)
buf->baseURL = New(ParsedURL);
- parseURL(p, buf->baseURL, NULL);
+ parseURL2(p, buf->baseURL, &buf->currentURL);
#if defined(USE_M17N) || defined(USE_IMAGE)
base = buf->baseURL;
#endif