Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Re: [maxq-dev] a patch for URLs that are not properly URL encoded

maxq
Discussion topic

Back to topic list

Re: [maxq-dev] a patch for URLs that are not properly URL encoded

Author oliverbock
Full name Oliver Bock
Date 2005-06-21 15:33:39 PDT
Message Hi Brian,

I was going to apply your patch, but unfortunately the file (and the
function) you have modified has changed since the release your patch is
based on. Would you consider applying for the developer role and
applying your patch to the CVS root?


    Oliver

--
On 22/06/2005, at 04:35, Brian Moore wrote:

> hello,
>
> i've been using maxq on a site that doesn't properly URL encode
> its URLs. while this is incorrect i can't change them, so i've
> modified maxq to deal properly with these malformed URLs.
>
> in particular the urls are of the form:
> htp://host:port/foo/bar/baz?q=%
> they intended q to hold the string "%" but this is obviously
> incorrect. it's a very special case, and i don't know if you'd
> like to take the patch or not, but i'm providing it in case
> you'd like to take it. please find it attached and below,
>
> b
>
> --- before Tue Jun 21 11:10:28 2005
> +++ HttpTestCase.java Mon Jun 20 16:32:34 2005
> @@ -203,12 +203,18 @@
> for(int count=0; count<s.length(); count++){
> if(s.charAt(count)=='%'){
> count++;
> - int a=Character.digit(s.​charAt(count++),16);​
> - a=a<<4;
> - int b=Character.digit(s.​charAt(count),16);
> - // prefix ' (ascii 39) or " (ascii 132) with '\' (ascii 92)
> - if ( a+b == 39 || a+b == 132 ) out.write(92);
> - out.write(a+b);
> + if(count < s.length()) {
> + int a=Character.digit(s.​charAt(count++),16);​
> + a=a<<4;
> + int b=Character.digit(s.​charAt(count),16);
> + // prefix ' (ascii 39) or " (ascii 132) with '\' (ascii 92)
> + if ( a+b == 39 || a+b == 132 ) out.write(92);
> + out.write(a+b);
> + }
> + else {
> + // pass through a final %
> + out.write('%');
> + }
> }
> else {
> if(s.charAt(count)=='+')
>
>
> ____________________​____________________​__________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> <patch>-------​--------------------​--------------------​-----------------
> -----
> To unsubscribe, e-mail: dev-unsubscribe at maxq dot tigris dot org
> For additional commands, e-mail: dev-help at maxq dot tigris dot org

« Previous message in topic | 2 of 6 | Next message in topic »

Messages

Show all messages in topic

a patch for URLs that are not properly URL encoded brianmooreca Brian Moore 2005-06-21 11:35:28 PDT
     Re: [maxq-dev] a patch for URLs that are not properly URL encoded oliverbock Oliver Bock 2005-06-21 15:33:39 PDT
         Re: [maxq-dev] a patch for URLs that are not properly URL encoded brianmooreca Brian Moore 2005-06-21 16:15:52 PDT
             Re: [maxq-dev] a patch for URLs that are not properly URL encoded brianmooreca Brian Moore 2005-06-22 00:24:18 PDT
                 Re: [maxq-dev] a patch for URLs that are not properly URL encoded oliverbock Oliver Bock 2005-06-22 00:32:29 PDT
                     Re: [maxq-dev] a patch for URLs that are not properly URL encoded brianmooreca Brian Moore 2005-06-22 09:23:15 PDT
Messages per page: