RESOLVED FIXED Bug 24011
KURL's setPort doesn't unset port if 0 is given
https://bugs.webkit.org/show_bug.cgi?id=24011
Summary KURL's setPort doesn't unset port if 0 is given
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.