PAC isPlainHostName() matching ipv6 addresses
Categories
(Core :: Networking, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox87 | --- | fixed |
People
(Reporter: luizluca, Assigned: yrahul3910, Mentored)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug, Whiteboard: [necko-triaged][good first bug][lang=js])
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36
Steps to reproduce:
In my PAC script, I have something like:
...
if (isPlainHostName(host)) {
return "DIRECT"
}
...
Actual results:
isPlainHostName returns true for addresses like: https://[2801:82:0:6::45]/
Expected results:
isPlainHostName should have returned false as it is not a plain host name. I guess it simply looks for '.', while it should now also consider ':'
Updated•4 years ago
|
Comment 1•4 years ago
|
||
Thanks for the report.
It seems the behaviour you suggest matches Chrome, so in the name of compatibility we should probably address this.
The fix belongs here.
Updated•4 years ago
|
I could do this; given the information above, it would appear the regex simply needs a tweak from checking for "." (match a dot) to "(.|:)". Does this seem right?
Also, might I suggest the use of String.raw
instead of the code you've pointed to? It's rather difficult to read as it stands, and I suspect this is partly because it was written pre-ES6.
(In reply to Rahul from comment #2)
Also, might I suggest the use ofString.raw
instead of the code you've pointed to? It's rather difficult to read as it stands, and I suspect this is partly because it was written pre-ES6.
This part was pre-coffee, sorry :) But I guess my point still stands: we could use the C++11 raw string literal syntax (R"..."
) instead.
Updated•4 years ago
|
Comment 5•4 years ago
|
||
This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.
Comment 6•4 years ago
|
||
Sorry for missing the notification.
I'll respond again in the review.
Updated•4 years ago
|
Comment 8•4 years ago
|
||
bugherder |
Description
•