Closed Bug 45891 Opened 25 years ago Closed 25 years ago

IPv6: "Host" header is wrong in requests to IPv6 literal addresses

Categories

(Core :: Networking, defect, P3)

x86
Linux
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: lennox, Assigned: jgmyers)

References

()

Details

(Whiteboard: awaiting approval)

Attachments

(1 file)

(This bug report is largely thanks to David Madore. I tracked down the specific RFC grammar references.) When one uses Mozilla to retrieve a URL with a literal IPv6 address and port number, e.g. http://[::1]:8088/foo/ (this means "get relative /foo/ from HTTP server on port 8088 of the loopback address (::1) using the syntax defined by RFC 2732), the request it sends to the port is something like this: GET /foo/ HTTP/1.1 Host: ::1:8088 User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.17pre10-emerald i686; en-US; m17) Gecko/20000709 Accept: */* Accept-Language: en Accept-Encoding: gzip,deflate,compress,identity Keep-Alive: 300 Connection: keep-alive Note in particular the "Host" header. RFC 2617 (HTTP) defines the syntax of the "Host" header as: Host = "Host" ":" host [ ":" port ] ; Section 3.2.2 Section 3.2.2 gives the grammar of the http URL. Therefore, for IPv6 literal addresses the Host header needs to follow the RFC 2732 grammar for "host", just as with URLs: host = hostname | IPv4address | IPv6reference IPv6reference = "[" IPv6address "]" Without this, the server cannot tell whether what is meant is port 8088 of host ::1 rather than (default) port 80 of host ::1:8088 (which is a valid IPv6 address). The correct way for the "Host" header to appear in this request is Host: [::1]:8088 Experimentally, using the KAME IPv6 patch for Apache-1.3.12, it seems that the latter syntax is recognized (and the former is not)
Status: NEW → ASSIGNED
Attached patch proposed fixSplinter Review
Reassigning to module owner for review and checkin (I don't have CVS access).
Assignee: jgmyers → gagan
Status: ASSIGNED → NEW
Whiteboard: have fix
Keywords: patch, review
Keywords: nsbeta3
I have CVS access now, but I need review and approval.
I reviewed jgmyers' patch and think it is good. (I am not the module owner.)
Target Milestone: --- → Future
seems reasonable to me... r=gagan
Target Milestone: Future → M18
Using strchr seems inefficient -- it means scanning every host string so that the uncommon case of IPv6 literals is handled correctly -- but given that nsStdURL::AppendString does the same thing, I suppose it's reasonable.
Reassign to self, waiting for approval.
Assignee: gagan → jgmyers
Keywords: reviewapproval
Assign to waterson for approval.
Assignee: jgmyers → waterson
Whiteboard: have fix → awaiting approval
a=waterson. jgmeyers: in the future, just send me email or cc me on the bug; you don't have to assign the bug to me.
Assignee: waterson → jgmyers
Fix checked in.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
*** Bug 55815 has been marked as a duplicate of this bug. ***
Relieving tever of IPv6 related QA.
QA Contact: tever → benc
Jonathan: if this works for you, can you VERIFY this bug?
Summary: "Host" header is wrong in requests to IPv6 literal addresses → IPv6: "Host" header is wrong in requests to IPv6 literal addresses
-> pushing out networking qa of ipv6.
QA Contact: benc → ipv6
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: