[racket-dev] [plt] Push #27093: master branch updated

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Fri Jul 5 21:00:51 EDT 2013

On Fri, Jul 5, 2013 at 8:21 PM,  <eli at racket-lang.org> wrote:
>
>
> 8d55b89 Eli Barzilay <eli at racket-lang.org> 2013-07-05 20:20
> :
> | Further explain silent acceptance of unencoded characters.
> |
> | Also highlight the two tests that use that.
> :
>   M pkgs/racket-pkgs/racket-test/tests/net/url.rkt | 7 +++++--
>   M racket/lib/collects/net/uri-codec.rkt          | 9 ++++++---
>
> =====[ Overall Diff ]===================================================
>
> pkgs/racket-pkgs/racket-test/tests/net/url.rkt
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> --- OLD/pkgs/racket-pkgs/racket-test/tests/net/url.rkt
> +++ NEW/pkgs/racket-pkgs/racket-test/tests/net/url.rkt
> @@ -44,7 +44,7 @@
>          => (->vec expected)))
>
>  (provide tests)
> -(module+ main (tests))
> +(module+ main (test do (tests)))
>  (define (tests)
>    (test
>     ;; Test the current-proxy-servers parameter can be set
> @@ -254,9 +254,12 @@
>    (test-s->u #("mailto" #f #f #f #f (#("robby at racket-lang.org")) () #f)
>               "mailto:robby at racket-lang.org")
>
> +  ;; The following two tests are not really correct: they rely on the URL
> +  ;; decoding silently passing un-encoded text as is instead of barfing.  (Eg,
> +  ;; using these URLs in a browser and then copy-pasting it from the address
> +  ;; should get you a properly encoded string instead.)

This parenthetical is not really correct.  In particular, you cannot
rely on what's displaying in the browser address bar to be a
correctly-encoded URL -- the address bar is part of the user
interface, and not a reflection of the internal state.

For some discussion on this point, see this thread:
https://groups.google.com/d/topic/mozilla.dev.platform/V0XjJ-uQbcI/discussion

In general, the whole URL parser should probably be changed/re-written
to follow http://url.spec.whatwg.org/ but that's a longer-term
project.

Sam

Posted on the dev mailing list.