Bug 24011

Summary: KURL's setPort doesn't unset port if 0 is given
Product: WebKit Reporter: Gustavo Noronha (kov) <gustavo>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Trivial    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Bug Depends on: 41443    
Bug Blocks:    
Attachments:
Description Flags
proposed fix ap: review+

Gustavo Noronha (kov)
Reported 2009-02-18 15:17:57 PST
In KURL.h setPort has the following comment: // Setting the port to 0 will clear any port from the URL. void setPort(unsigned short); But passing 0 sets port to :0 instead.
Attachments
proposed fix (2.08 KB, patch)
2009-02-18 15:43 PST, Gustavo Noronha (kov)
ap: review+
Gustavo Noronha (kov)
Comment 1 2009-02-18 15:43:02 PST
Created attachment 27765 [details] proposed fix
Alexey Proskuryakov
Comment 2 2009-02-19 02:21:12 PST
Comment on attachment 27765 [details] proposed fix r=me > + Make setPort remove port if 0 is given to it, as promissed by the Typo: should be "promised". > // FIXME: Non-ASCII characters must be encoded and escaped to match parse() expectations, > // and to avoid changing more than just the port. Oops, this FIXME is totally bogus - this method takes a number, so there is no need to encode it! Please feel free to remove it if you wish. > + if (!i) We'd normally put the normal code path first (if (i)).
Gustavo Noronha (kov)
Comment 3 2009-02-19 07:20:39 PST
Landed in r41076.
Note You need to log in before you can comment on or make changes to this bug.