The default bug view has changed. See this FAQ.

Expose mUploadStreamHasHeaders on the HttpBaseChannel to allow removing appended headers to nsIUploadChannel

RESOLVED FIXED in Firefox 7

Status

()

Core
Networking
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Honza, Assigned: mayhemer)

Tracking

Trunk
mozilla7
x86
Windows Vista
Points:
---

Firefox Tracking Flags

(firefox7 fixed)

Details

(Whiteboard: [firebug-p2][qa-])

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
This bug has been originally created for Firebug here:
http://code.google.com/p/fbug/issues/detail?id=4327

Firebug is using (nsIUploadChannel) request.uploadStream to read data
posted with an HTTP request.

STR:
The problem appears if you load following page:
http://getfirebug.com/tests/issues/4327/

Check the action.php requests (note that Flash is used to post that data). When Firebug reads posted data from the upload channel it looks as follows:

Content-type: application/x-www-form-urlencoded
Content-length: 26

data=%7Bfoo%3A%27foo%27%7D

But WireShark shows only:

data=%7Bfoo%3A%27foo%27%7D

===

There is no way how to safely clear away these headers so, Firebug
shows the same as Wireshark.

Boris is proposing:
Firebug could check the value of mUploadStreamHasHeaders on the HttpBaseChannel, but it's not exposed anywhere. 

You can also read related discussion:
http://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/1faabb0d0a8d26f7?hl=en#

Honza
(Reporter)

Updated

6 years ago
Whiteboard: [firebug-p2]
Honza (mayhemer), does that make sense?  Want to write a patch?
Version: 1.9.1 Branch → Trunk
Yes, it perfectly makes sense for me.  It is a very simple solution.
What about the second question?  ;)
(In reply to comment #3)
> What about the second question?  ;)

I can do that :)
Assignee: nobody → honzab.moz
Status: NEW → ASSIGNED
(Reporter)

Comment 5

6 years ago
Can we target Firefox 6? What flag should I set (if any)?

Honza
There is no flag.  If it gets done in time, it gets in.  If if doesn't, it doesn't.
My plan is to put readonly attribute bool uploadStreamHasHeaders to one of nsIUploadChannel or nsIUploadChannel2 or (and it is the question) new nsIUploadChannel3 interface.

What is a desired option?  I believe Honza prefers to modify nsIUploadChannel2.  Me probably too.
(Reporter)

Comment 8

6 years ago
(In reply to comment #7)
> I believe Honza prefers to modify nsIUploadChannel2
Yes

Honza
Created attachment 532691 [details] [diff] [review]
v1 [Check in comment 11]
Attachment #532691 - Flags: review?(bzbarsky)
Comment on attachment 532691 [details] [diff] [review]
v1 [Check in comment 11]

Please use "boolean" in the IDL, not PRBool.  r=me with that.
Attachment #532691 - Flags: review?(bzbarsky) → review+
Comment on attachment 532691 [details] [diff] [review]
v1 [Check in comment 11]

http://hg.mozilla.org/mozilla-central/rev/a54c69c20b6c
http://hg.mozilla.org/mozilla-central/rev/9ad384bc560c (comment fix)
Attachment #532691 - Attachment description: v1 → v1 [Check in comment 11]
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
status-firefox7: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
Hello. 

Could anyone provide some simple STRs for verifying this issue?
If firebug now uses this feature, I'd consider that verification enough.
(Reporter)

Comment 14

6 years ago
I can see that a new attribute: nsIUploadChannel2.uploadStreamHasHeaders
has been created.

So, how am I suppose to clear the headers so, Firebug shows the same post-data as Wireshark? (see comment #0)

Honza
You read from the stream until you get to a CRLF CRLF.  Everything before then is headers.  Everything after that is data.  Basically, when uploadStreamHasHeaders the stream contains the end of the HTTP request headers and the blank line and then the request body.
(Reporter)

Comment 16

6 years ago
(In reply to Boris Zbarsky (:bz) from comment #15)
> You read from the stream until you get to a CRLF CRLF.  Everything before
> then is headers.  Everything after that is data.  Basically, when
> uploadStreamHasHeaders the stream contains the end of the HTTP request
> headers and the blank line and then the request body.

Thanks Boris!
Honza
qa-: fix verification unnecessary
Whiteboard: [firebug-p2] → [firebug-p2][qa-]
(Reporter)

Comment 18

6 years ago
Note that the original Firebug bug
http://code.google.com/p/fbug/issues/detail?id=4327

is fixed and verified by the reporter.

Honza
You need to log in before you can comment on or make changes to this bug.