hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sung-Gu" <jeri...@apache.org>
Subject Re: cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient HttpMethodBase.java
Date Sat, 25 Jan 2003 03:33:47 GMT
Hi,

The URI class is integrated with some part of httpclient now...
But there are some misuses.  I just showed exmaples by report.

I don't know path is required to have an escaped form or not...
But setQueryString in HttpMethodBase is, I know...

There is some inconsitent uses internally... as I see.

Sung-Gu

----- Original Message -----
From: <jericho@apache.org>
To: <jakarta-commons-cvs@apache.org>
Sent: Saturday, January 25, 2003 12:28 PM
Subject: cvs commit:
jakarta-commons/httpclient/src/java/org/apache/commons/httpclient
HttpMethodBase.java


> jericho     2003/01/24 19:28:30
>
>   Modified:    httpclient/src/java/org/apache/commons/httpclient
>                         HttpMethodBase.java
>   Log:
>   Fix a bug not to set an escaped query.
>   (The setQueryString method requires an escaped form)
>
>   Reported by Joseph Artsimovich <joseph@dkd.lt>
>
>   Revision  Changes    Path
>   1.97      +14 -8
jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethod
Base.java
>
>   Index: HttpMethodBase.java
>   ===================================================================
>   RCS file:
/home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/
HttpMethodBase.java,v
>   retrieving revision 1.96
>   retrieving revision 1.97
>   diff -u -r1.96 -r1.97
>   --- HttpMethodBase.java 23 Jan 2003 22:47:47 -0000 1.96
>   +++ HttpMethodBase.java 25 Jan 2003 03:28:29 -0000 1.97
>   @@ -289,6 +289,7 @@
>                        parsedURI.getScheme()
>                    );
>                }
>   +            // else { FIXME: just in case, is not abolsute uri, then?
>
>                // set the path, defaulting to root
>                setPath(
>   @@ -296,7 +297,7 @@
>                    ? "/"
>                    : parsedURI.getPath()
>                );
>   -            setQueryString( parsedURI.getQuery() );
>   +            setQueryString( parsedURI.getEscapedQuery() );
>
>            } catch ( URIException e ) {
>                throw new IllegalArgumentException(
>   @@ -324,7 +325,9 @@
>
>            if ( hostConfiguration == null ) {
>                // just use a relative URI, the host hasn't been set
>   -            return new URI( null, null, path, queryString, null );
>   +            URI tmpUri = new URI(null, null, path, null, null);
>   +            tmpUri.setEscapedQuery(queryString);
>   +            return tmpUri;
>            } else {
>
>                // we only want to include the port if it's not the default
>   @@ -333,14 +336,17 @@
>                    port = -1;
>                }
>
>   -            return new URI(
>   +            URI tmpUri = new URI(
>                    hostConfiguration.getProtocol().getScheme(),
>                    null,
>                    hostConfiguration.getHost(),
>                    port,
>                    path,
>   -                queryString
>   +                null // to set an escaped form
>                );
>   +            tmpUri.setEscapedQuery(queryString);
>   +            return tmpUri;
>   +
>            }
>
>        }
>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:commons-dev-help@jakarta.apache.org>
>

Mime
View raw message