Mixed/upper case URL's don't work in mozilla

VERIFIED FIXED in M15

Status

()

Core
Networking
P3
normal
VERIFIED FIXED
19 years ago
19 years ago

People

(Reporter: jst, Assigned: Warren Harris)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [PDT+]w/b minus on 03/10 [Fix attached], URL)

Attachments

(1 attachment)

(Reporter)

Description

19 years ago
Clicking on urls with uppercase characters in the scheme (protocol) field
doesn't work correctly on any platform. Currently it works on Win32 because of
bug #22712 but once that is fixed Win32 will break too!

The reason for this is that if a user clicks on a HTtp://... link the networking
code tries to create a

	component://netscape/network/protocol?name=HTtp

component, this is wrong, it should be

	component://netscape/network/protocol?name=http

Same thing happends with JavaScript url's and probably others.
(Assignee)

Updated

19 years ago
Assignee: gagan → warren
Target Milestone: M15
(Assignee)

Comment 1

19 years ago
asdf

Comment 2

19 years ago
fix for this in ANDREAS_URL_BRANCH

Comment 3

19 years ago
*** Bug 24783 has been marked as a duplicate of this bug. ***
(Reporter)

Comment 4

19 years ago
This is XP now.

This is only partly fixed (I assume ANDREAS_URL_BRANCH landed yesterday),
HTtp://... works now but JavaScript:... doesn't work yet...
OS: Linux → All
Hardware: PC → All
Summary: Mixed/upper case URL's don't work in non-win32 mozilla → Mixed/upper case URL's don't work in mozilla

Comment 5

19 years ago
javascript urls seem to work a very different way, does anyone know where to
look?
(Reporter)

Comment 6

19 years ago
This patch fixes the JavaScript:... handling but I'm afraid this will brake
other things, unless protocols are *allways* lowercase?

--- nsSimpleURI.cpp     2000/02/03 03:44:10     1.15
+++ nsSimpleURI.cpp     2000/02/03 18:42:05
@@ -105,6 +105,7 @@
     NS_ASSERTION(n == count, "Mid failed");
     if (mScheme) 
         nsCRT::free(mScheme);
+    scheme.ToLowerCase();
     mScheme = scheme.ToNewCString();
     if (mScheme == nsnull)
         return NS_ERROR_OUT_OF_MEMORY;

Comment 7

19 years ago
I think this patch is safe, the only mixed case scheme I could find was
mailboxMessage and this is gone now.
(Reporter)

Comment 8

19 years ago
I vaguely remember seeing IMAP:... urls someplace but I might be wrong, and they
could even be hadled by their own URI implementation, couldn't they. If you
the patch is OK then please go ahead and check it in...
(Assignee)

Comment 9

19 years ago
It seems wrong for me to have nsStdURL lowercase the scheme name. We fixed the 
protocol lookup to be case insensitive. There must be another case we have to 
fix somewhere.
(Reporter)

Comment 10

19 years ago
Warren, note that it was nsSimpleURI and not nsStdURL, but it still might be
wrong...

Comment 11

19 years ago
Warren: Both has to happen. First we have to lowercase to search and find the
right component. And second we have to lowercase the scheme to move urls like
HtTp://www.mozilla.org to http://www.mozilla.org which is only cosmetical but
looks much nicer. We are already doing it in nsStdURL.cpp with the landing of
ANDREAS_URL2_BRANCH.

So what's missing now is to lowercase at the place where the
"javascript-protocol-handler" is searched for if something like this exists. 
(Assignee)

Comment 12

19 years ago
It's arguable whether javascript: mailboxmessage: looks nicer than JavaScript: 
or MailboxMessage:. I think we should leave the URL as typed. The 
case-insensitive comparison should happen elsewhere.

Comment 13

19 years ago
If I remove the lowercasing of the scheme in the urlparser case four of the
testcase does not work anymore. There must be more places than in nsIOService
where the search for the protocol is case sensitive.
(Reporter)

Comment 14

19 years ago
I just realized that if I type "http://www.MOZILLA.Org" into the URL bar and hit
enter the url I just typed is changed to "http://www.mozilla.org". Is this due
to some of the changes that were made to fix this bug or is it unrelated to
those changes?

Comment 15

19 years ago
No, that was related to a very similar bug, now fixed, can't find the number at
the moment

Comment 16

19 years ago
Very likely a dup of 21686.

Comment 17

19 years ago
No, not a dup, try the testcase. Here is something different beyond lowercasing
the scheme while trying to get the right protocol-handler. To fix this we
currently have to really lowercase the scheme in the URIs. This is currently
done with Std-Urls, but not with Simple-Urls, and that's why the javascript
example fails. There must be another case of case-sensitive comparison for the
scheme, it's just not found yet.

Comment 18

19 years ago
Okay, found it. It was the securitymanager. See the attached patch to make it
caseinsensitive. 

Also target="_blank" seems to be currently broken, the new browser instances are
created but you can't see them. They appear briefly when you shutdown the app.
But that's another problem.

Comment 19

19 years ago
Created attachment 5201 [details] [diff] [review]
Patch to make CheckLoadURI caseinsensitive

Comment 20

19 years ago
*** Bug 27765 has been marked as a duplicate of this bug. ***
Nominating for beta1, this is nothing really serious but the fix is available
and this would make more websites work without much effort, and I bet we'll get
(more) dups of this one if it's not fixed before beta1.
Keywords: beta1
Whiteboard: [Fix attached]

Comment 22

19 years ago
better patch is on bug 29419

Comment 23

19 years ago
*** Bug 30655 has been marked as a duplicate of this bug. ***

Comment 24

19 years ago
*** Bug 29995 has been marked as a duplicate of this bug. ***

Comment 25

19 years ago
Putting on PDT+ for beta1. Please fix by 03/10
Whiteboard: [Fix attached] → [PDT+]w/b minus on 03/10 [Fix attached]

Updated

19 years ago
Depends on: 29419
As far as I can tell this was fixed when norris fixed bug 29419, marking as
such, please reopen if you disagree.
Status: NEW → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED

Updated

19 years ago
No longer depends on: 29419

Comment 27

19 years ago
verified:
Linux 2000030809
Mac 2000030808
NT 2000030809
Status: RESOLVED → VERIFIED

Comment 28

19 years ago
*** Bug 31260 has been marked as a duplicate of this bug. ***

Comment 29

19 years ago
*** Bug 31243 has been marked as a duplicate of this bug. ***

Comment 30

19 years ago
*** Bug 31243 has been marked as a duplicate of this bug. ***

Comment 31

19 years ago
*** Bug 31243 has been marked as a duplicate of this bug. ***

Comment 32

19 years ago
*** Bug 31974 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.