Closed
Bug 403480
Opened 17 years ago
Closed 17 years ago
setting nsIURI::port to its default value shouldn't be possible
Categories
(Core :: Networking, defect, P1)
Core
Networking
Tracking
()
RESOLVED
FIXED
mozilla1.9beta2
People
(Reporter: Gavin, Assigned: Gavin)
Details
Attachments
(1 file)
1.06 KB,
patch
|
Biesinger
:
review+
Biesinger
:
superreview+
mtschrep
:
approval1.9+
|
Details | Diff | Splinter Review |
The existing code seems to make it impossible to set port to it's default value except in one specific case: set it to a different port and then set it back to the default. This seems inconsistent.
Assignee | ||
Comment 1•17 years ago
|
||
Assignee: nobody → gavin.sharp
Status: NEW → ASSIGNED
Attachment #288311 -
Flags: superreview?(cbiesinger)
Attachment #288311 -
Flags: review?(cbiesinger)
Assignee | ||
Comment 2•17 years ago
|
||
The reason I looked into this was the patch for bug 396316, which has: + // If the URI explicitly specified a port, only include it when + // it's not the default. (We never want "http://foo.com:80") + port = uri.port; + if (port != -1) { + var handler = this._ioService.getProtocolHandler(scheme); + if (port != handler.defaultPort) + realm += ":" + port; + } I'm assuming this change means that the getProtocolHandler/defaultPort code wouldn't be necessary, and it could just check for -1. Is that a safe assumption?
Assignee | ||
Comment 3•17 years ago
|
||
Comment on attachment 288311 [details] [diff] [review] patch (I suppose the comment isn't quite right in the case of mDefaultPort == -1, suggestions for a better one are welcome.)
Comment 4•17 years ago
|
||
Hmm, while we're here perhaps an input value of "-1" (or any negative number, really) should also be illegal? "http://google.com:-1" doesn't seem like it should work, but it does.
Updated•17 years ago
|
Attachment #288311 -
Flags: superreview?(cbiesinger)
Attachment #288311 -
Flags: superreview+
Attachment #288311 -
Flags: review?(cbiesinger)
Attachment #288311 -
Flags: review+
Assignee | ||
Comment 5•17 years ago
|
||
Comment on attachment 288311 [details] [diff] [review] patch Simple correctness fix that'll help simplify the patch for blocker bug 396316.
Attachment #288311 -
Flags: approval1.9?
Updated•17 years ago
|
Attachment #288311 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Updated•17 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 6•17 years ago
|
||
mozilla/netwerk/base/src/nsStandardURL.cpp 1.102
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Priority: -- → P1
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9 M10
Updated•17 years ago
|
Keywords: checkin-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•