jakarta-jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Molettiere <pie...@santoshima.org>
Subject Re: cvs commit: jakarta-jmeter/src/org/apache/jmeter/protocol/http/sampler HTTPSampler.java
Date Fri, 08 Jun 2001 16:05:44 GMT


Minor aesthetic point, but this code will
always append a "?" to every GET request...
whether there is a query string or not.

Another thing to consider, which is afaik
a legal construct...

<form action="/servlet/someservlet?arg=value" method="POST">
[input fields]
</form>

which will result in both a query string, and 
post arguments.

Granted, many CGI implementations don't deal 
with this correctly, but I've found most browsers
do.


P)

mstover1@apache.org wrote:
>   -             if(!getPath().startsWith("/"))
>   +             String pathAndQuery = null;
>   +             if(this.getMethod().equals(this.GET))
>                 {
>   -                     setPath("/"+getPath());
>   +                     pathAndQuery = this.getPath()+"?"+getQueryString();
>                 }
>   +             else
>   +             {
>   +                     pathAndQuery = this.getPath();
>   +             }
>   +             if(!pathAndQuery.startsWith("/"))
>   +             {
>   +                     pathAndQuery = "/" + pathAndQuery;
>   +             }
>                 if(getPort() == 0)
>                 {
>   -                     return new URL(getProtocol(),getDomain(),getPath());
>   +                     return new URL(getProtocol(),getDomain(),pathAndQuery);
>                 }
>                 else
>                 {
>   -                     return new URL(getProtocol(), (String)properties.get(DOMAIN),
getPort(), (String)properties.get(PATH));
>   +                     return new URL(getProtocol(), (String)properties.get(DOMAIN),
getPort(),
>   +                                               pathAndQuery);
>                 }

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


Mime
View raw message