[racket] Preventing get-impure-port from url-encoding the query
(excuse me for butting in here...)
I'd add my agreement that the referenced spec rfc 3986 supports Evan's
usage with the definition being very clear on this point. The ? should
not be encoded. On the other hand the preceding rfc 1738 (3.3)
specifies that the ? is a reserved character in the "searchpart" (i.e.
query string). There will be many apps out there which adhere to 1738
and not 3986, and the two are clearly incompatible.
If you try Evan's url in the W3 School's encoding test page
http://www.w3schools.com/tags/ref_urlencode.asp it operates like
Racket's url api. I don't think Racket's behavior is out of line with
expected behavior, but it does seem that there should be a "way out"
for either creating a url with unencoded query parameters, or
supplying a raw url string.
On the other hand, it might be worth a mention to the developers of
the web app which expects raw unencoded urls to be sent within a query
string ... not really a good idea imo and experience.
Erik.
On Thu, Jul 11, 2013 at 11:39 AM, Sam Tobin-Hochstadt <samth at ccs.neu.edu> wrote:
> First, I think in this particular case the RFCs agree with Evan here.
> In particular, see section 3.4 of RFC 3896:
> http://tools.ietf.org/html/rfc3986#section-3.4 which defines query
> strings as containing a sequence of either 'pchar', "/" or "?", where
> 'pchar' includes ":", ascii alphanumeric characters, "." and
> 'sub-delims', which includes "=".
>
> Second, you (and I) may not like the specification style demonstrated
> in the URL spec, but that's the direction that a lot of web standards
> are going. You can see it in the HTML spec, too:
> http://www.w3.org/TR/html5/ . These are the specifications that
> implementors of web browsers and web servers are paying attention to
> and contributing to, and thus they're the ones we need to pay
> attention to.
>
> Sam
>
> On Thu, Jul 11, 2013 at 2:19 PM, Jay McCarthy <jay.mccarthy at gmail.com> wrote:
>> This debate is bigger than you and me, but I don't see a spec here. I
>> see a weird pseudo-code parsing algorithm with no specification. In
>> any case, the net/url module implements the RFCs. If those aren't what
>> you want, then it needs to be changed or a new module needs to be
>> implemented. Given the big different between the RFCs and this new
>> "specification", I gather there won't be a lot of shared code.
>>
>> Jay
>>
>> On Thu, Jul 11, 2013 at 12:16 PM, Sam Tobin-Hochstadt <samth at ccs.neu.edu> wrote:
>>> I'm not sure which spec you're looking at from there, but the URL spec
>>> that I linked to is the most current work on precisely specifying
>>> URLs.
>>>
>>> On Thu, Jul 11, 2013 at 2:14 PM, Jay McCarthy <jay.mccarthy at gmail.com> wrote:
>>>> I'm looking at the spec: http://www.w3.org/Addressing/
>>>>
>>>> On Thu, Jul 11, 2013 at 11:59 AM, Sam Tobin-Hochstadt <samth at ccs.neu.edu> wrote:
>>>>> On Thu, Jul 11, 2013 at 1:46 PM, Jay McCarthy <jay.mccarthy at gmail.com> wrote:
>>>>>> On Wed, Jul 10, 2013 at 5:27 PM, Evan Donahue <emdonahu at gmail.com> wrote:
>>>>>>> Hello, I am trying to use the racket networking libraries for a basic set of
>>>>>>> get and post requests. I need to send a url of the form:
>>>>>>>
>>>>>>> http://foo.com/?url=http://bar.com?baz=1000 (NOT form encoded)
>>>>>>
>>>>>> As far as I can tell from URL specs, this is not a URL.
>>>>>
>>>>> I don't think that's correct. In particular, see
>>>>> http://url.spec.whatwg.org/#query-state and step 3 there, as well as
>>>>> the definition on URL code point here:
>>>>> http://url.spec.whatwg.org/#url-code-points which includes all of the
>>>>> characters in Evan's query.
>>>>>
>>>>> Sam
>>>>
>>>>
>>>>
>>>> --
>>>> 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
>>
>>
>>
>> --
>> 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
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users
--
Erik Pearson
Adaptations
;; web form and function