[Seaside-dev] WAUrl gap analysis

Sven Van Caekenberghe sven at stfx.eu
Mon Apr 21 22:30:39 UTC 2014


Hi Philippe,

On 21 Apr 2014, at 22:47, Philippe Marschall <philippe.marschall at gmail.com> 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
> seaside-dev at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev



More information about the seaside-dev mailing list