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)

defect

Tracking

()

RESOLVED FIXED
mozilla0.9.8

People

(Reporter: ikarus, Assigned: darin.moz)

References

()

Details

Attachments

(1 file, 2 obsolete files)

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.
accepting, attaching proposed patch in a second
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Keywords: patch, review
Attached patch proposed patch (obsolete) — Splinter Review
really taking bug this time
Assignee: darin → Morten
Status: ASSIGNED → NEW
giving away to reporter, as I apparently didn't understand the rfc well enough
Assignee: Morten → ikarus
actually, your patch doesn't solve the problem. the problem is with the if (port == -1) line... it skips over the [] encapsulation.
Attached patch patch (obsolete) — Splinter Review
this patch should get it right... reporter: please verify. thx!
Attachment #64252 - Attachment is obsolete: true
-> reassigning to self.
Assignee: ikarus → darin
wow, darin... I was just about to attach an almost exactly equal patch ...
That patch appaers to be a correct fix, it always encapsulates IPv6 IP's as specified in RFC 2732
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.
thx jag :-) how about an sr= with those changes?
Status: NEW → ASSIGNED
Attachment #64254 - Attachment is obsolete: true
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.
nope... that one is necessary since PL_strchr operates on a |const char *|
Priority: -- → P3
Target Milestone: --- → mozilla0.9.8
Comment on attachment 64329 [details] [diff] [review] v2 diff - revised per jag's comments r=morten@nilsen.com
Attachment #64329 - Flags: review+
Comment on attachment 64329 [details] [diff] [review] v2 diff - revised per jag's comments sr=jag
Attachment #64329 - Flags: superreview+
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.

Attachment

General

Creator:
Created:
Updated:
Size: