You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by Eric Siegerman <er...@telepres.com> on 2002/08/13 23:36:57 UTC

Multipart problems (was Re: HTTP Proxy URL-encoding woes)

On Tue, Aug 13, 2002 at 03:53:58PM -0400, Mike Stover wrote:
> If JMeter isn't doing multiparts right, that's news.  Have you tried again since I committed 
> today's fix?

I have.  It's still URL-encoding them :-(  I'll enter it into bugzilla.

Here's a further clue.  When I look at the resulting HTTP Request element
in JMeter, it shows a single parameter, whose name is:
	-----------------------------135049002710252023621189641421
	Content-Disposition: form-data; name

and whose value is:
	"headline"

	yada yada
	-----------------------------135049002710252023621189641421
	Content-Disposition: form-data; name="dirText"

	blah blah blah

	-----------------------------135049002710252023621189641421
	[many more parts deleted]

Looks as though it missed the Content-Type: header, and parsed
the body as though it were application/x-www-form-urlencoded.
The whole thing was treated as a single name/value pair, split on
the first "=" -- the one in:
	Content-Disposition: form-data; name="headline"

I guess the body happened happened not to contain any "&"s.  Sure
enough, if I resubmit the form with an "&" typed into one of the
text fields, JMeter shows me two name/value pairs with all the
boundaries at the expected (though of course still bogus) places.

--

|  | /\
|-_|/  >   Eric Siegerman, Toronto, Ont.        erics@telepres.com
|  |  /
Anyone who swims with the current will reach the big music steamship;
whoever swims against the current will perhaps reach the source.
	- Paul Schneider-Esleben

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Multipart problems (was Re: HTTP Proxy URL-encoding woes)

Posted by Mike Stover <ms...@apache.org>.
I had a thought on this - instead of making a subclass of hashmap, I could instead 
use the Header object that JMeter has as the Key in the Map, and change the 
Header objects "equals()" and "hashCode()" methods.  I think that would work well.

-Mike

On 14 Aug 2002 at 13:26, Eric Siegerman wrote:

> On Tue, Aug 13, 2002 at 07:46:31PM -0400, Mike Stover wrote:
> > On 13 Aug 2002 at 18:56, Eric Siegerman wrote:
> > I could change all headers to lower case without a subclass of hashmap - but that would be 
> > altering the data as it goes through the proxy, wouldn't it - something you were complaining 
> > about earlier.
> 
> Doh!  I guess I don't know the code well enough to be discussing
> it in such detail.
> 
> --
> 
> |  | /\
> |-_|/  >   Eric Siegerman, Toronto, Ont.        erics@telepres.com
> |  |  /
> Anyone who swims with the current will reach the big music steamship;
> whoever swims against the current will perhaps reach the source.
> 	- Paul Schneider-Esleben
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 



--
Michael Stover
mstover1@apache.org
Yahoo IM: mstover_ya
ICQ: 152975688

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Multipart problems (was Re: HTTP Proxy URL-encoding woes)

Posted by Eric Siegerman <er...@telepres.com>.
On Tue, Aug 13, 2002 at 07:46:31PM -0400, Mike Stover wrote:
> On 13 Aug 2002 at 18:56, Eric Siegerman wrote:
> I could change all headers to lower case without a subclass of hashmap - but that would be 
> altering the data as it goes through the proxy, wouldn't it - something you were complaining 
> about earlier.

Doh!  I guess I don't know the code well enough to be discussing
it in such detail.

--

|  | /\
|-_|/  >   Eric Siegerman, Toronto, Ont.        erics@telepres.com
|  |  /
Anyone who swims with the current will reach the big music steamship;
whoever swims against the current will perhaps reach the source.
	- Paul Schneider-Esleben

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Multipart problems (was Re: HTTP Proxy URL-encoding woes)

Posted by Mike Stover <ms...@apache.org>.
On 13 Aug 2002 at 18:56, Eric Siegerman wrote:

>[snip]

> Of course, this is only one of a large number of cases.  E.g. The
> above was generated by ver. 6.2.3.  I just tried it with Netscape
> 4.8; it spells "Content-type" as above, and also does
> "Content-length" the same way.  Rather than patching case by
> case, it'd be safer to write a case-insensitive HashMap subclass
> (of course, keys would have to be String's, not Object's; each
> method just needs to zap any keys to lower case before delegating
> to HashMap).

I could change all headers to lower case without a subclass of hashmap - but that would be 
altering the data as it goes through the proxy, wouldn't it - something you were complaining 
about earlier.  What we need is a hashmap subclass that compares values in a case-
insensitive way, but stores them faithfully.  This is what I understood Jason Height's 
suggestion to be.  Anyone who wants to take that on, feel free.  I'll use it when you send it in!

--
Michael Stover
mstover1@apache.org
Yahoo IM: mstover_ya
ICQ: 152975688

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Multipart problems (was Re: HTTP Proxy URL-encoding woes)

Posted by Eric Siegerman <er...@telepres.com>.
On Tue, Aug 13, 2002 at 06:19:35PM -0400, Mike Stover wrote:
> I notice something strange from the log you sent.  Look at the following headers:
> 
> Keep-Alive: 300
> Proxy-Connection: keep-alive
> Referer: 
> http://lawrencium.telepres.com:23000/easypub/access?objName=ep15.C.PGMGR.com_att_A
> nnouncement_PGMGR_PageManager&action=edit&editMessage=createMessage&%24%24S
> ESSION%24%24=%7BauthID%7D%3B%7BuserID%7D%3B%7Brole%7D%3B%7BprintNam
> e%7D&role=member&printName=Eric&userID=eks2&authID=2269eb1c%3Aef8c4b857a%3A-
> 7fee2f80e0
> Content-type: multipart/form-data; boundary=---------------------------
> 135049002710252023621189641421
> Content-Length: 960
> 
> Notice that "Content-type" is the only one that doesn't capitalize the word after the "-".

That's Linux Netscape doing that.  Slightly odd, perhaps, but
it's within spec: "Field names are case-insensitive." [RFC 2068,
first paragraph of Sec. 4.2]

> JMeter 
> looks for the value of "Content-Type", and I wonder if it's missing it in your case.  I can update 
> JMeter to be more inclusive in looking for it and see if that solves your problem

Yup; it works.  Thanks much!

Of course, this is only one of a large number of cases.  E.g. The
above was generated by ver. 6.2.3.  I just tried it with Netscape
4.8; it spells "Content-type" as above, and also does
"Content-length" the same way.  Rather than patching case by
case, it'd be safer to write a case-insensitive HashMap subclass
(of course, keys would have to be String's, not Object's; each
method just needs to zap any keys to lower case before delegating
to HashMap).

--

|  | /\
|-_|/  >   Eric Siegerman, Toronto, Ont.        erics@telepres.com
|  |  /
Anyone who swims with the current will reach the big music steamship;
whoever swims against the current will perhaps reach the source.
	- Paul Schneider-Esleben

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Multipart problems (was Re: HTTP Proxy URL-encoding woes)

Posted by Mike Stover <ms...@apache.org>.
I notice something strange from the log you sent.  Look at the following headers:

Keep-Alive: 300
Proxy-Connection: keep-alive
Referer: 
http://lawrencium.telepres.com:23000/easypub/access?objName=ep15.C.PGMGR.com_att_A
nnouncement_PGMGR_PageManager&action=edit&editMessage=createMessage&%24%24S
ESSION%24%24=%7BauthID%7D%3B%7BuserID%7D%3B%7Brole%7D%3B%7BprintNam
e%7D&role=member&printName=Eric&userID=eks2&authID=2269eb1c%3Aef8c4b857a%3A-
7fee2f80e0
Content-type: multipart/form-data; boundary=---------------------------
135049002710252023621189641421
Content-Length: 960

Notice that "Content-type" is the only one that doesn't capitalize the word after the "-".  JMeter 
looks for the value of "Content-Type", and I wonder if it's missing it in your case.  I can update 
JMeter to be more inclusive in looking for it and see if that solves your problem

-Mike


On 13 Aug 2002 at 17:36, Eric Siegerman wrote:

> On Tue, Aug 13, 2002 at 03:53:58PM -0400, Mike Stover wrote:
> > If JMeter isn't doing multiparts right, that's news.  Have you tried again since I committed 
> > today's fix?
> 
> I have.  It's still URL-encoding them :-(  I'll enter it into bugzilla.
> 
> Here's a further clue.  When I look at the resulting HTTP Request element
> in JMeter, it shows a single parameter, whose name is:
> 	-----------------------------135049002710252023621189641421
> 	Content-Disposition: form-data; name
> 
> and whose value is:
> 	"headline"
> 
> 	yada yada
> 	-----------------------------135049002710252023621189641421
> 	Content-Disposition: form-data; name="dirText"
> 
> 	blah blah blah
> 
> 	-----------------------------135049002710252023621189641421
> 	[many more parts deleted]
> 
> Looks as though it missed the Content-Type: header, and parsed
> the body as though it were application/x-www-form-urlencoded.
> The whole thing was treated as a single name/value pair, split on
> the first "=" -- the one in:
> 	Content-Disposition: form-data; name="headline"
> 
> I guess the body happened happened not to contain any "&"s.  Sure
> enough, if I resubmit the form with an "&" typed into one of the
> text fields, JMeter shows me two name/value pairs with all the
> boundaries at the expected (though of course still bogus) places.
> 
> --
> 
> |  | /\
> |-_|/  >   Eric Siegerman, Toronto, Ont.        erics@telepres.com
> |  |  /
> Anyone who swims with the current will reach the big music steamship;
> whoever swims against the current will perhaps reach the source.
> 	- Paul Schneider-Esleben
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 



--
Michael Stover
mstover1@apache.org
Yahoo IM: mstover_ya
ICQ: 152975688

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>