Closed Bug 113508 Opened 23 years ago Closed 23 years ago

Identical URIs do not compare via nsIURI::Equals

Categories

(Core :: Networking, defect, P1)

x86
Windows 2000
defect

Tracking

()

RESOLVED FIXED
mozilla0.9.7

People

(Reporter: adamlock, Assigned: darin.moz)

Details

(Whiteboard: [ready-to-land])

Attachments

(2 files, 1 obsolete file)

If I create a new URI object (e.g. via NS_NewURI) from "http://cnn" and another
from "http://cnn/", they both become a URI with a "http://cnn/" spec but calling
uri1->Equal(uri2, &isEqual) returns PR_FALSE.

It looks like that trailing slash on the input screws up how mBasename is
calculated, so when they are compared, the URLSegments differ. In particular
mBasename.mLen is -1 in the first and 0 in the second. 

Aside from being wrong it may impact the performance of the cache and other areas.
Search for "http://cnn" to see the difference that the trailing slash makes on
how the URI is stored and comparisons are made.
the cache actually just uses URL strings not URL objects to differentiate cache
entries, so this bug shouldn't impact caching.  however, this bug is still very
critical IMO.

-> 0.9.7
Severity: normal → critical
Priority: -- → P1
Target Milestone: --- → mozilla0.9.7
Status: NEW → ASSIGNED
Attachment #60388 - Attachment is obsolete: true
Attached patch v1.0 patchSplinter Review
this patch fixed the problem.  ran url parsing tests w/ this patch applied and
didn't notice any regressions.
andreas: can i get an r= from you on the v1.0 patch?  thx!
Keywords: patch
Whiteboard: [patch needs r/sr=]
Comment on attachment 60398 [details] [diff] [review]
v1.0 patch

sr=rpotts@netscape.com
Attachment #60398 - Flags: superreview+
Whiteboard: [patch needs r/sr=] → [ready-to-land]
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: