Bug 16836
Summary: | JS navigation to host-less HTTP URL (http:/path/to/file) generates error | ||
---|---|---|---|
Product: | WebKit | Reporter: | Liam Elbourne <liamdav> |
Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | mrowe |
Priority: | P2 | Keywords: | InRadar |
Version: | 528+ (Nightly build) | ||
Hardware: | Mac | ||
OS: | OS X 10.4 |
Liam Elbourne
When the "General Inquests" link is selected within the url:
"http://www.lawlink.nsw.gov.au/lawlink/coroners_court/ll_coroners.nsf/pages/coroners_information"
the script called by this link (OpenAttachmentWithFullPath) generates:
"http://lawlink/Coroners_Court/ll_coroners.nsf/vwFiles/InquestFAQs.doc/$file/InquestFAQs.doc"
which should be:
"http://www.lawlink.nsw.gov.au/lawlink/Coroners_Court/ll_coroners.nsf/vwFiles/InquestFAQs.doc/$file/InquestFAQs.doc"
ie the results, if any, of the script are not included.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Mark Rowe (bdash)
I think the URL is being generated correctly. The target of the link is:
javascript:OpenAttachmentWithFullPath('/lawlink/Coroners_Court/ll_coroners.nsf/vwFiles/InquestFAQs.doc/$file/InquestFAQs.doc')
The function is defined as follows:
function OpenAttachmentWithFullPath ( filePath ) {
window.open ( "http:" + filePath );
} // end of function
This results in http:/lawlink/Coroners_Court/ll_coroners.nsf/vwFiles/InquestFAQs.doc/$file/InquestFAQs.doc being loaded.
Another method of reproducing this bug is to go to http://webkit.org/blog/ and enter:
javascript:window.location = 'http:/'
in the address bar and press enter. In Safari this generates an error saying:
Safari can’t open the page “http:/” because it’s an invalid address.
In Firefox this loads http://webkit.org/. What is interesting is that Firefox gives a similar error to Safari if you enter "http:/" in the address bar.
I wonder what specifies the behaviour of a http:/path/to/file URL?
Mark Rowe (bdash)
I can reproduce this with Safari 3.0.4 on Mac OS X 10.5.x.
Mark Rowe (bdash)
A simple workaround for the website is to change OpenAttachmentWithFullPath to omit the leading http:. I've never seen http:/path/to/file-style URLs used in the wild before.
Mark Rowe (bdash)
<rdar://problem/5683164>