[racket] escaping binary data in url

From: Veer (diggerrrrr at gmail.com)
Date: Sat Aug 13 00:08:13 EDT 2011

This url http://localhost:8000/servlets/standalone.rkt?test=%ff
causes server to close connection whereas
http://localhost:8000/servlets/standalone.rkt?test=%23 does not , and
works as expected.

I suppose this is caused by use of net/url library, right?

On Fri, Aug 12, 2011 at 11:43 PM, Jay McCarthy <jay.mccarthy at gmail.com> wrote:
> That's what the Web Server stuffers do
>
> http://docs.racket-lang.org/web-server/stateless.html#(part._stuffers)
>
> On Fri, Aug 12, 2011 at 11:38 AM, Danny Yoo <dyoo at cs.wpi.edu> wrote:
>> The library already does some URL encoding for you, as "%" is an
>> illegal character in a query string, since that's the escape character
>> itself for arbitrary bytes,  "%25" gets translated down to...
>>
>> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>>> (integer->char (string->number "25" 16))
>> #\%
>> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>>
>> ... that percent sign.
>>
>>
>> Would using base64-encode (from the net/base64 library) work for you?
>> You can take your bytes and feed them through base64-encode; the
>> result should be something that can be a part of URLs.
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://lists.racket-lang.org/listinfo/users
>>
>
>
>
> --
> Jay McCarthy <jay at cs.byu.edu>
> Assistant Professor / Brigham Young University
> http://faculty.cs.byu.edu/~jay
>
> "The glory of God is Intelligence" - D&C 93
>



Posted on the users mailing list.