links to file:C:/... don't resolve correctly

VERIFIED INVALID

Status

()

VERIFIED INVALID
15 years ago
14 years ago

People

(Reporter: pratik.solanki, Assigned: darin.moz)

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

15 years ago
Load an HTML file which is say C:\Temp\test.html

If the file has an image link as follows

<img src="file:C:/Temp/image.jpg" />

Mozilla (firefox) resolved it to file:///C:/Temp/C:/Temp/image.jpg and does not
find the image. I've noticed this on Windows 2000, Firefox build 20040618.

Comment 1

15 years ago
Since some / are missing here, what should Mozilla do here? Since there is no
leading /, Mozilla assumes this is a relative path, which is probably right. So
i think this bug is invalid.
(Reporter)

Comment 2

15 years ago
If you type file:C:/Temp/image.jpg in the location bar, mozilla converts that to
file:///C:/Temp/image.jpg. Any reason why links should be different? 

On Windows, Mozilla should probably not assume this to be a relative path.
Shouldn't it look to see if the path starts with '[A-Z]:' and figure out its an
absolute path?

IE resolves file:C:/... to file:///C:/...

Comment 3

15 years ago
(In reply to comment #2)
> If you type file:C:/Temp/image.jpg in the location bar, mozilla converts that to
> file:///C:/Temp/image.jpg. Any reason why links should be different? 

What chance does Mozilla have :), since there can't be anything like relative
links in the url-bar.

The location bar is different and you can type "c:" in the location bar and
Mozilla will convert that to file:///c:/ but that doesn`t mean that mozilla
should convert a link with "c:test.html".
hmm, bug 163225 and bug 32966 did this intentionally, to treat such urls relative...

Comment 6

15 years ago
This happens because we support for some time now an old deprecated form of
relative urls, something like http:/path/file or http:file. If the base url has
the same scheme as the new url we take those urls as relative. 

In this case we have a base-url file:///C:/Temp/test.html and an url to resolve
which looks like: file:C:/Temp/image.jpg

This matches the old deprectated relative urls perfectly and we get
file:///C:/Temp/C:/Temp/image.jpg

This all happens in the urlparser and resolver for relative urls which is
platform independent and has to be. RFC 2396 is the guideline and in this scope
C:/Temp/image.jpg is a very strange looking filename, nothing more nothing less.
It can not assume anything about the OS. In urls an absolute path has to start
with a '/' otherwise it is a filename or some other part of an url.

Bottom line: fix the url in the link. It is broken if you want it to be
absolute, add at least one / after 'file:' better add three!
so this is invalid. thanks, andreas.
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → INVALID
(Assignee)

Comment 8

14 years ago
Verified INVALID
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.