Closed Bug 64488 (backslash) Opened 19 years ago Closed 9 years ago

backslashes in URLs are handled improperly

Categories

(Core :: Networking, defect, minor)

x86
Linux
defect
Not set
minor

Tracking

()

RESOLVED INVALID

People

(Reporter: s2mdalle, Unassigned)

References

()

Details

From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.2.18 i686)
BuildID:    2000110321

When a backslash '\' is placed before the end of a hostname in a URL, it is
taken to be part of the selector string rather than part of the hostname. For
example, if you go to "http://some.site.com\/" rather than trying to connect to
"some.site.com\" and selecting "/" from the server, mozilla connects to
"some.site.com" and asks for "\/" which gives a bad request from most webservers
I've seen.

This should work with any URL you can think of. Just put a backslash as the last
character of the hostname.

Reproducible: Always
Steps to Reproduce:
Take a given hostname somehost.com

Go to http://somehost.com\/

Actual Results:  I got a BadRequest back from the server. I believe that this
means that mozilla is actually asking for "\/" from the server, which doesn't
make any sense.

Expected Results:  It should have done one of two things - it should have
complained that "\" is not a valid character inside of a hostname, or it should
have actually tried to connect to "hostname.com\" (and then of course failed,
since that's not a valid hostname) What it should do is interpret the \ as part
of the hostname and not the selector string.

Of course responses may differ depending on what server the other site is
running, but I've consistently gotten BadRequest from apache based sites.
RFC 2396 section 2.4.3 says "\" is not allowed within URIs.
invalid
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Component: Browser-General → Parser
Resolution: --- → INVALID
verif. invalid
Status: RESOLVED → VERIFIED
Component: Parser → Networking
*** Bug 292862 has been marked as a duplicate of this bug. ***
*** Bug 289389 has been marked as a duplicate of this bug. ***
*** Bug 278857 has been marked as a duplicate of this bug. ***
*** Bug 121839 has been marked as a duplicate of this bug. ***
*** Bug 283941 has been marked as a duplicate of this bug. ***
*** Bug 250449 has been marked as a duplicate of this bug. ***
*** Bug 271938 has been marked as a duplicate of this bug. ***
*** Bug 275709 has been marked as a duplicate of this bug. ***
*** Bug 283204 has been marked as a duplicate of this bug. ***
*** Bug 258167 has been marked as a duplicate of this bug. ***
*** Bug 176312 has been marked as a duplicate of this bug. ***
*** Bug 237053 has been marked as a duplicate of this bug. ***
*** Bug 279904 has been marked as a duplicate of this bug. ***
*** Bug 299412 has been marked as a duplicate of this bug. ***
*** Bug 302191 has been marked as a duplicate of this bug. ***
(In reply to comment #1)
> RFC 2396 section 2.4.3 says "\" is not allowed within URIs.

It is not allowed in URIs as you said.
However MS's IE allows this, and probably the IIS allows this.
So, many people, who are even CS major, don't recognize this problem, and when
they give an URL to their students or.. whomever, they use "\" instead of "/".

Probably it would be good if the Mozilla translate the \ to /, or Mozilla people
operate an education site in Spread Firefox website. :)
Alias: backslash
*** Bug 306943 has been marked as a duplicate of this bug. ***
Mozilla Firefox should open such an URL because they are common in EVERY website
made with MS Word.

I don't like sites made with MS Word but their content is sometimes very usefull
for me... I NEED opening such documents !!!!

What should I do ? Warm every webmaster of the world that their site is not
valid sending them to the w3 validator ?

Do you really think that people using MS Word for making HTML documents
understand (and agree) with such a speech !

I don't think so...

What I think... is that a browser which warm user that the content is not
valid... but who try to make its best to have a viewable document is a good
browser !!

A browser that say "I **** M$ Word and their dirty web page", web page is not
valid so I don't want to show you this page
such a browser is not very usefull for me when I NEED to see a document...

Sometimes freedom and interoperability need some concession

Sorry if my opinion is not valid according many RFC... ;-)
 
Please consider to reopen the bug

Regards
*** Bug 307802 has been marked as a duplicate of this bug. ***
What should we do to reopen the bug ?

What should we do to solve the problem ?

Maybe making an extension for this is possible...
*** Bug 308021 has been marked as a duplicate of this bug. ***
*** Bug 308083 has been marked as a duplicate of this bug. ***
Solution !!!

Use following bookmarklet

javascript:(function(){var
a=RegExp('%'+'5C','gi');location=(''+location).replace(a,'/').replace(/\\/g,'/').replace(/\/$/,'');})()

granding rights to use, copy, modify or distribute
*** Bug 315895 has been marked as a duplicate of this bug. ***
*** Bug 317981 has been marked as a duplicate of this bug. ***
*** Bug 317384 has been marked as a duplicate of this bug. ***
*** Bug 320538 has been marked as a duplicate of this bug. ***
*** Bug 320740 has been marked as a duplicate of this bug. ***
I hope that will be correct in nex fireFox update, realise ...
see bug 32895 , this is not bug
*** Bug 322665 has been marked as a duplicate of this bug. ***
*** Bug 323720 has been marked as a duplicate of this bug. ***
*** Bug 329246 has been marked as a duplicate of this bug. ***
*** Bug 335088 has been marked as a duplicate of this bug. ***
*** Bug 341162 has been marked as a duplicate of this bug. ***
*** Bug 341204 has been marked as a duplicate of this bug. ***
*** Bug 345163 has been marked as a duplicate of this bug. ***
*** Bug 345163 has been marked as a duplicate of this bug. ***
*** Bug 348487 has been marked as a duplicate of this bug. ***
*** Bug 356478 has been marked as a duplicate of this bug. ***
Duplicate of this bug: 377213
Duplicate of this bug: 385658
I vote for this one. IMO supporting backslashes will do no harm as it will not break anything. And I don't think we can manage to educate those Windows web designers and to make Microsoft change Word or FrontPage.
Duplicate of this bug: 402804
Duplicate of this bug: 412569
Duplicate of this bug: 429041
Information for those who has the problem and needs to view those "bad" sites:

there is an add-on which can fix part of the problem:
https://addons.mozilla.org/en-US/firefox/addon/2871

However it just won't fix links like this:
<a href="\test\test.html">this is a test</a>

So we still have to use IE in some cases.
Why is this bug classified as 'invalid'? There are numerous sites out there, built with **** generators, that can't be viewed with Firefox. Users will blame Firefox, something we can't accept IMHO. For example, check this company website (!!) that has this problem: http://www.vxstd.co.uk/yaesu/index.html
...because they believe IE is wrong the they are right to comply with the "standard" (not to mention, Opera is "wrong" too).

And your post is against their bugzilla rule btw, as they have rules which don't allow you whining about their decisions.
Does anybody know if this issue has been fixed in FF3?
This BUG hasn't been fixed in Firefox 3 either. 

Even the Microsoft Homepage is not working right because of this:
http://www.microsoft.com/learning/mcp/master/default.mspx
There are several links that look like that: <a href="\learning\mcp\master\products\default.mspx#EZ">


Answer from Microsoft EMEA MCP:
-------
Dear *

Thank you for your e-mail.

We kindly suggest you to use internet explorer browser because we do not
support Firefox.

In case of any further questions please feel free to contact with us.

Kind Regards

Dorota Wajs

Microsoft Regional Service Center
E-Mail: emeamcp@msdirectservices.com
Tel.: +49 5241 1796057
Fax: +49 5241 1796077
----


Answer from Microsoft Global Customer Service:
-------

Hello,

Thank you for contacting Microsoft Customer Service.

I understand that while trying to open a link on http://www.microsoft.com/learning/mcp/master/default.mspx on Firefox you are redirected to a different page.

For assistance regarding your concern, I recommend that you contact Mozilla Support Professionals who will be in a better position to assist you. To contact them, please visit the link below:

http://www.mozilla.com/en-US/about/contact.html

If you need further assistance, you may also contact Microsoft subsidiary that specializes in your version of Microsoft Product.  You can reach them at: 41 (0) 848 858 868 or by visiting:

http://www.microsoft.com/worldwide/phone/contact.aspx?country=Switzerland

I hope you are able to access your web link correctly and appreciate you patience in this regard.

Thank you,
Remya
Microsoft Customer Service Representative
----

If not even big companies like Microsoft care about fixing such a bug on there site how should small companies do. I recommend just implementing a fix that converts "\" into "/" like ALMOST ANY other browser does.

This won't hurt anybody but it will ensure that Firefox delivers the best possible experience.
(In reply to comment #55)
> If not even big companies like Microsoft care about fixing such a bug on there
> site how should small companies do. I recommend just implementing a fix that
> converts "\" into "/" like ALMOST ANY other browser does.

On the contrary, it is much easier to pwn a dinosaur than a rat, as the natural history shows.
Their decision processes make them unable to react, all that they can do is to follow the head.
Chris
An extension to fix this problem seems to exist
Link Fixer Thing
https://addons.mozilla.org/fr/firefox/addon/3230
unfortunately it doesn't seems to work under FF 3

I also try this extension
URL Fixer
https://addons.mozilla.org/fr/firefox/addon/2871
but it doesn't fix the backslash problem

I really think that this should be fixed in FF (and an alert should appear when having such a link on a webpage)

Kind regards
I found this extension that can fit to your needs :
Slashy 1.6.6
Fixes Windows backslash file separators in links and images
https://addons.mozilla.org/fr/firefox/addon/426
It works with Firefox 3
but I really think that is should be fixed in Firefox itself !
Couldn't we make Firefox handle backslashes like M$IE etc, and then open a bug saying "Firefox handles \ as /, this is incorrect"? Then this bug could be left as WONTFIX?

My argument: Firefox will "correctly" display the following:

test <b>of <i> html <u>compliance

even if it does not follow the standard, that is, not correctly written - there is no html body head etc tags. But even so, Firefox displays what the composer had in mind...

Why make life difficult for people switching to Firefox?
"test <b>of <i> html <u>compliance" is invalid indeed but not for the reasons you quoted.
OTOH, <vbscript:%22%3Cp%20%3Etest%20%3Cb%3Eof%20%3Ci%3E%20html%20%3Cu%3Ecompliance%3C/u%20%3E%3C/i%20%3E%3C/b%20%3E%22> makes a perfectly valid HTML document.
' "test <b>of <i> html <u>compliance" is invalid indeed '

Good. My point is, if that invalidity is not taken as an offence by Firefox, why should the backslash issue be such a stumbling stone?

Don't take me wrong: I DO NOT like the backslashing either, simply because it is not standard. But I think this is more of a user experience issue. I've tried to tell my company's IT department that our internal web page is not complying, but they keep telling be Firefox is to blame. I understand they're wrong, but will my non-technical colleagues?
How do you know, given a resource path A\B, whether it is a B in an A or an A\B?  I understand you assume the first but it is not clear that it is the correct assumption in all cases.
Duplicate of this bug: 516108
Duplicate of this bug: 516115
Duplicate of this bug: 516896
Assignee: asa → nobody
QA Contact: doronr → networking
Duplicate of this bug: 516896
Duplicate of this bug: 536658
I have been using Firefox for a long time. But this bug always forced me to use Chrome sometimes. So I had to keep Chrome running next to Firefox. I guess many people are annoyed by this bug. I did not know that the backslash is the problem. I just could not call up some sites in Firefox and so tried Chrome.

Why does Firefox want to lose us to Chrome? They are working on extension too.

For now I found by accident this add-on

https://addons.mozilla.org/fr/firefox/addon/426

Hard to believe that I have to use it and it might slow down my performance. And the developer had to fix leaks in this add-on too. Perhaps with the next update of Firefox it might not work anymore anyway.

Chrome will win in the end I am afraid. BUT Firefox was right. A \ is not a / ;-)
Duplicate of this bug: 588519
Duplicate of this bug: 187930
Now HTML5 defines replacing backslashes to forward slashes as a "willful violation".
http://dev.w3.org/html5/spec/Overview.html#resolving-urls
Reopening since this bug is no longer invalid per HTML5 spec.
Status: VERIFIED → REOPENED
Ever confirmed: true
Resolution: INVALID → ---
Please do not reopen ancient bugs. Instead file a new bug. Thank you for your cooperation.
Status: REOPENED → RESOLVED
Closed: 19 years ago9 years ago
Resolution: --- → INVALID
Duplicate of this bug: 657217
Duplicate of this bug: 686243
Duplicate of this bug: 241432
Duplicate of this bug: 343276
Duplicate of this bug: 444314
Duplicate of this bug: 726537
Duplicate of this bug: 672853
Duplicate of this bug: 73701
Duplicate of this bug: 860720
You need to log in before you can comment on or make changes to this bug.