Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Wrong data in nsIUploadChannel

55 views
Skip to first unread message

Jan Honza Odvarko

unread,
Apr 11, 2011, 1:18:56 PM4/11/11
to
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.

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

Check the action.php requests. 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

Any ideas where the additional header came from?

Note that Flash is used to post that data.

Honza

Boris Zbarsky

unread,
Apr 11, 2011, 1:35:28 PM4/11/11
to
On 4/11/11 10:18 AM, Jan Honza Odvarko wrote:
> 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.
>
> The problem appears if you load following page:
> http://getfirebug.com/tests/issues/4327/
>
> Check the action.php requests. 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

What are you looking at in Wireshark? The full HTTP request? Or just
the request body?

> Note that Flash is used to post that data.

In which case some of the headers will be in the upload stream, yes.

-Boris

Jan Honza Odvarko

unread,
Apr 11, 2011, 1:50:33 PM4/11/11
to
On Apr 11, 7:35 pm, Boris Zbarsky <bzbar...@mit.edu> wrote:
> On 4/11/11 10:18 AM, Jan Honza Odvarko wrote:
>
>
>
>
>
>
>
>
>
> > 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.
>
> > The problem appears if you load following page:
> >http://getfirebug.com/tests/issues/4327/
>
> > Check the action.php requests. 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
>
> What are you looking at in Wireshark?  The full HTTP request?  Or just
> the request body?
I am looking just at the request body, seeing 26 bytes:
data=%7Bfoo%3A%27foo%27%7D

Honza

Boris Zbarsky

unread,
Apr 11, 2011, 4:57:17 PM4/11/11
to
On 4/11/11 10:50 AM, Jan Honza Odvarko wrote:
>> What are you looking at in Wireshark? The full HTTP request? Or just
>> the request body?
> I am looking just at the request body, seeing 26 bytes:
> data=%7Bfoo%3A%27foo%27%7D

OK, that's correct. The stream on upload channels can contain headers,
not just body data, as you saw.

-Boris

Jan Honza Odvarko

unread,
Apr 12, 2011, 2:17:54 AM4/12/11
to
So, Firefox (or a plugin) appends these headers to request body?

Is there any way how to safely clear away these headers so, Firebug
shows the same
request body as WireShark?

Honza

Boris Zbarsky

unread,
Apr 12, 2011, 3:14:44 AM4/12/11
to
On 4/11/11 11:17 PM, Jan Honza Odvarko wrote:
>> OK, that's correct. The stream on upload channels can contain headers,
>> not just body data, as you saw.
> So, Firefox (or a plugin) appends these headers to request body?

The upload stream is appended to the HTTP request once the part Firefox
plans to put in is done. If the HTTP request's headers are not done at
that point (which is controlled by how SetUploadStream was called), the
upload stream can add headers.

> Is there any way how to safely clear away these headers so, Firebug
> shows the same
> request body as WireShark?

As things stand, looks like no. You'd need to check the value of
mUploadStreamHasHeaders on the HttpBaseChannel, and that's not exposed
anywhere I can see.

File a bug to expose it?

-Boris

Jan Honza Odvarko

unread,
Apr 12, 2011, 10:55:56 AM4/12/11
to
0 new messages