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)
Tracking
()
RESOLVED
FIXED
M18
People
(Reporter: lennox, Assigned: jgmyers)
References
()
Details
(Whiteboard: awaiting approval)
Attachments
(1 file)
935 bytes,
patch
|
Details | Diff | Splinter Review |
(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)
Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•25 years ago
|
||
Assignee | ||
Comment 2•25 years ago
|
||
Reassigning to module owner for review and checkin (I don't have CVS access).
Assignee: jgmyers → gagan
Status: ASSIGNED → NEW
Whiteboard: have fix
Assignee | ||
Comment 3•25 years ago
|
||
I have CVS access now, but I need review and approval.
Comment 4•25 years ago
|
||
I reviewed jgmyers' patch and think it is good.
(I am not the module owner.)
Reporter | ||
Comment 6•25 years ago
|
||
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.
Assignee | ||
Comment 7•25 years ago
|
||
Reassign to self, waiting for approval.
Assignee | ||
Comment 8•25 years ago
|
||
Assign to waterson for approval.
Assignee: jgmyers → waterson
Whiteboard: have fix → awaiting approval
Comment 9•25 years ago
|
||
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
Assignee | ||
Comment 10•25 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 11•25 years ago
|
||
*** Bug 55815 has been marked as a duplicate of this bug. ***
Comment 13•23 years ago
|
||
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
You need to log in
before you can comment on or make changes to this bug.
Description
•