Closed
Bug 119103
Opened 23 years ago
Closed 23 years ago
Host: header not being send correctly for IPv6 IP's
Categories
(Core :: Networking: HTTP, defect, P3)
Core
Networking: HTTP
Tracking
()
RESOLVED
FIXED
mozilla0.9.8
People
(Reporter: ikarus, Assigned: darin.moz)
References
()
Details
Attachments
(1 file, 2 obsolete files)
1.07 KB,
patch
|
Morten
:
review+
jag+mozilla
:
superreview+
|
Details | Diff | Splinter Review |
Mozilla seems to wrongly assume that only IPv6 IP's in the Host: header for wich
a port is given should be encapsulated in []'s, while all (?) httpd's assume to
get it encapsulated in []'s always.
Comment 1•23 years ago
|
||
accepting, attaching proposed patch in a second
Comment 2•23 years ago
|
||
Comment 4•23 years ago
|
||
giving away to reporter, as I apparently didn't understand the rfc well enough
Assignee: Morten → ikarus
Assignee | ||
Comment 5•23 years ago
|
||
actually, your patch doesn't solve the problem. the problem is with the if
(port == -1) line... it skips over the [] encapsulation.
Assignee | ||
Comment 6•23 years ago
|
||
this patch should get it right... reporter: please verify. thx!
Attachment #64252 -
Attachment is obsolete: true
Comment 8•23 years ago
|
||
wow, darin... I was just about to attach an almost exactly equal patch ...
Reporter | ||
Comment 9•23 years ago
|
||
That patch appaers to be a correct fix, it always encapsulates IPv6 IP's as
specified in RFC 2732
Comment 10•23 years ago
|
||
Attachment #64254 -
Flags: review+
Comment 11•23 years ago
|
||
Comment on attachment 64254 [details] [diff] [review]
patch
>Index: nsHttpChannel.cpp
>===================================================================
>RCS file: /cvsroot/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp,v
>retrieving revision 1.74
>diff -u -r1.74 nsHttpChannel.cpp
>--- nsHttpChannel.cpp 8 Jan 2002 22:39:18 -0000 1.74
>+++ nsHttpChannel.cpp 10 Jan 2002 05:37:16 -0000
>@@ -172,17 +172,19 @@
> // Set request headers
> //
> nsCString hostLine;
nsCAutoString would be better.
>- if (port == -1)
>- hostLine.Assign(host.get());
>- else if (PL_strchr(host.get(), ':')) {
>+ if (PL_strchr(host.get(), ':')) {
>+ // host is an IPv6 address literal and must be encapsulated in []'s
> hostLine.Assign('[');
> hostLine.Append(host.get());
No need for .get() here.
> hostLine.Append(']');
>- } else {
>+ }
>+ else
> hostLine.Assign(host.get());
Nor here.
Assignee | ||
Comment 12•23 years ago
|
||
thx jag :-) how about an sr= with those changes?
Status: NEW → ASSIGNED
Assignee | ||
Comment 13•23 years ago
|
||
Attachment #64254 -
Attachment is obsolete: true
Comment 14•23 years ago
|
||
Comment on attachment 64329 [details] [diff] [review]
v2 diff - revised per jag's comments
>+ nsCAutoString hostLine;
>+ if (PL_strchr(host.get(), ':')) {
You forgot one it seems.
Assignee | ||
Comment 15•23 years ago
|
||
nope... that one is necessary since PL_strchr operates on a |const char *|
Assignee | ||
Updated•23 years ago
|
Priority: -- → P3
Target Milestone: --- → mozilla0.9.8
Comment 16•23 years ago
|
||
Comment on attachment 64329 [details] [diff] [review]
v2 diff - revised per jag's comments
r=morten@nilsen.com
Attachment #64329 -
Flags: review+
Comment 17•23 years ago
|
||
Comment on attachment 64329 [details] [diff] [review]
v2 diff - revised per jag's comments
sr=jag
Attachment #64329 -
Flags: superreview+
Assignee | ||
Comment 18•23 years ago
|
||
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.
Description
•