Closed Bug 649338 Opened 10 years ago Closed 10 years ago
Upload Stream Has Headers on the Http Base Channel to allow removing appended headers to ns IUpload Channel
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
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
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.
(In reply to comment #7) > I believe Honza prefers to modify nsIUploadChannel2 Yes Honza
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]
Hello. Could anyone provide some simple STRs for verifying this issue?
If firebug now uses this feature, I'd consider that verification enough.
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.
(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-]
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.