Closed Bug 464162 Opened 11 years ago Closed 11 years ago

Apache does not accept IPv6 addresses with a scope id in the Host: header

Categories

(Core :: Networking: HTTP, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: masa141421356, Assigned: masa141421356)

References

(Blocks 1 open bug, )

Details

(Keywords: fixed1.9.1)

Attachments

(1 file, 4 obsolete files)

See https://issues.apache.org/bugzilla/show_bug.cgi?id=35122
-- 
When entering a scoped IPv6 address in Firefox, that same address is put in the HTTP Host: header.
But Apache rejects it with a 400 Bad Request and logs "Client sent malformed Host header" in the error log.
I think , we should remove scope id before adding IPv6 address to Host: header.

http://mxr.mozilla.org/firefox/source/netwerk/protocol/http/src/nsHttpChannel.cpp?rev=1.334#213
OS: Windows XP → All
Hardware: PC → All
Attached patch Patch rev1.0 (for Trunk) (obsolete) — Splinter Review
Sorry, I don't have IPv6 test environment. Please test this patch.
Assignee: nobody → masa141421356
Status: NEW → ASSIGNED
Attachment #348423 - Flags: review?(cbiesinger)
Attached patch Patch rev.1.01 (obsolete) — Splinter Review
Patch rev.1.0 removes character before "%".
"-1" in parameter of Left() is not needed.
Attachment #348423 - Attachment is obsolete: true
Attachment #348559 - Flags: review?(cbiesinger)
Attachment #348423 - Flags: review?(cbiesinger)
Comment on attachment 348559 [details] [diff] [review]
Patch rev.1.01

+        if (scopeIdPos < 0)

should be:
  if (scopeIdPos == kNotFound)

+            nsCAutoString ipv6Addr;
+            host.Left(ipv6Addr,scopeIdPos);
+            hostLine.Append(ipv6Addr);

should be:
  hostLine.Append(Substring(host, 0, scopeIdPos));

thanks for the patch!
Attachment #348559 - Flags: review?(cbiesinger) → review-
(note that I haven't tested this yet, I can do that tomorrow)
Attached patch Patch rev.1.02 (obsolete) — Splinter Review
Attachment #348559 - Attachment is obsolete: true
Attachment #348753 - Flags: review?(cbiesinger)
Attachment #348753 - Flags: superreview?(bzbarsky)
Attachment #348753 - Flags: review?(cbiesinger) → review-
Comment on attachment 348753 [details] [diff] [review]
Patch rev.1.02

I tested this now and it does work.


You didn't make the kNotFound change.

Also, you should remove the brackets here for consistency now:
+        else if (scopeIdPos > 0) {
+            hostLine.Append(Substring(host, 0, scopeIdPos));
+        }
Attached patch Patch Rev.1.03 (obsolete) — Splinter Review
Sorry for spam.
Attachment #348753 - Attachment is obsolete: true
Attachment #348754 - Flags: superreview?(bzbarsky)
Attachment #348754 - Flags: review?(cbiesinger)
Attachment #348753 - Flags: superreview?(bzbarsky)
Comment on attachment 348754 [details] [diff] [review]
Patch Rev.1.03

can you please fix my other comment as well
Attachment #348754 - Flags: review?(cbiesinger) → review-
Comment on attachment 348754 [details] [diff] [review]
Patch Rev.1.03

Please ask for sr once this has r=  (though I'd think biesi can r+sr this one).
Attachment #348754 - Flags: superreview?(bzbarsky)
(In reply to comment #10)
> (From update of attachment 348754 [details] [diff] [review])
> can you please fix my other comment as well

Oops, removing blacket is missing.
Attachment #348754 - Attachment is obsolete: true
Attachment #348758 - Flags: review?(cbiesinger)
Attachment #348758 - Flags: superreview+
Attachment #348758 - Flags: review?(cbiesinger)
Attachment #348758 - Flags: review+
Attachment #348758 - Flags: approval1.9.1?
Attachment #348758 - Flags: approval1.9.0.6?
Depends on: 466264
Version: unspecified → Trunk
Comment on attachment 348758 [details] [diff] [review]
Patch Rev.1.04
[Checkin: Comment 14]

a191=beltzner
Attachment #348758 - Flags: approval1.9.1? → approval1.9.1+
Attachment #348758 - Attachment description: Patch Rev.1.04 → Patch Rev.1.04 [Checkin: Comment 14]
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [c-n: baking for 1.9.1]
Target Milestone: --- → mozilla1.9.2a1
Attachment #348758 - Flags: approval1.9.0.6? → approval1.9.0.6-
Comment on attachment 348758 [details] [diff] [review]
Patch Rev.1.04
[Checkin: Comment 14]

This fix is not in the scope of our maintenance releases.
Duplicate of this bug: 499835
Duplicate of this bug: 501584
You need to log in before you can comment on or make changes to this bug.