WAUrl gap analysis

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

WAUrl gap analysis

Philippe Marschall
Hi

I finally found time to read [1]. It looks to me as if these are the
tests that we should pass but currently fail:

"serialization"
    url := WAUrl new.
    url host: 'example.com'.
    url addToPath: 'blue+light blue'.
    url queryFields at: 'blue+light blue' put: nil.
    self assert: url greaseString =
'http://example.com/blue+light%20blue?blue%2Blight+blue'

"parsing"
    url := (WAUrl absolute:
'http://example.com/blue+light%20blue?blue%2Blight+blue')
        decodedWith: GRNullCodec new.
    self assert: url path first = 'blue+light blue'.
    self assert: (url queryFields includesKey: 'blue+light blue').

    url := (WAUrl absolute: 'http://example.com/blue%2Fred%3Fand+green')
        decodedWith: GRNullCodec new.
    self assert: url path first = 'blue/red?and+green'

 [1] http://blog.lunatech.com/2009/02/03/what-every-web-developer-must-know-about-url-encoding

Cheers
Philippe
_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: WAUrl gap analysis

Sven Van Caekenberghe-2
Hi Philippe,

On 21 Apr 2014, at 22:47, Philippe Marschall <[hidden email]> wrote:

> Hi
>
> I finally found time to read [1]. It looks to me as if these are the
> tests that we should pass but currently fail:

I agree. ZnUrl (the Url class in Pharo) passes your tests, except for the last issue in the first test: the encoding of the space between light and blue as a +, not %20. We had some discussions about that and the conclusion was not to do that, although we accept it in most cases.

Sven

http://en.wikipedia.org/wiki/Percent-encoding#The_application.2Fx-www-form-urlencoded_type

> "serialization"
>    url := WAUrl new.
>    url host: 'example.com'.
>    url addToPath: 'blue+light blue'.
>    url queryFields at: 'blue+light blue' put: nil.
>    self assert: url greaseString =
> 'http://example.com/blue+light%20blue?blue%2Blight+blue'
>
> "parsing"
>    url := (WAUrl absolute:
> 'http://example.com/blue+light%20blue?blue%2Blight+blue')
>        decodedWith: GRNullCodec new.
>    self assert: url path first = 'blue+light blue'.
>    self assert: (url queryFields includesKey: 'blue+light blue').
>
>    url := (WAUrl absolute: 'http://example.com/blue%2Fred%3Fand+green')
>        decodedWith: GRNullCodec new.
>    self assert: url path first = 'blue/red?and+green'
>
> [1] http://blog.lunatech.com/2009/02/03/what-every-web-developer-must-know-about-url-encoding
>
> Cheers
> Philippe
> _______________________________________________
> seaside-dev mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev

_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev