Quantcast

Happstack routing + boomerang + non-ascii urls

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Happstack routing + boomerang + non-ascii urls

Semen Trygubenko / Семен Тригубенко
Dear Haskell-Cafe,

Last weekend I was test driving Web.Routes.Boomerang. A
great package … Is there any way I could make it work with
urls containing non-ASCII characters?

Happstack.Server routing using "path" handles non-ASCII,
as in, for instance,

dir "work" $ path $ workHandler ,

where workHandler gets a correctly decoded path segment
passed in as a String. The following, however,

sitemap :: Router Sitemap
sitemap = (
    rWork . anyString
)

passes to Work constructor an incorrectly decoded String.

All the plumbing re embedding boomerang route into a normal
Happstack one, etc. is done as per example from crash course
here:

http://happstack.com/docs/crashcourse/WebRoutes.html#web-routes-boomerang

Many thanks,

Sem

--
Семен Тригубенко

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Happstack routing + boomerang + non-ascii urls

Jeremy Shaw-3
That is concerning and mysterious. 

In Web.Routes.Happstack we do:

>            let f   = runSite (domain `Text.append` approot) siteSpec (map Text.pack $ rqPaths rq)

so, boomerang should be using the properly decoded rqPaths from the Happstack Request. Not sure where things are going wrong. I'll look at it soon, when I get a chance.

- jeremy

On Tue, Mar 27, 2012 at 8:17 AM, Semen Trygubenko <[hidden email]> wrote:
Dear Haskell-Cafe,

Last weekend I was test driving Web.Routes.Boomerang. A
great package … Is there any way I could make it work with
urls containing non-ASCII characters?

Happstack.Server routing using "path" handles non-ASCII,
as in, for instance,

dir "work" $ path $ workHandler ,

where workHandler gets a correctly decoded path segment
passed in as a String. The following, however,

sitemap :: Router Sitemap
sitemap = (
   rWork . anyString
)

passes to Work constructor an incorrectly decoded String.

All the plumbing re embedding boomerang route into a normal
Happstack one, etc. is done as per example from crash course
here:

http://happstack.com/docs/crashcourse/WebRoutes.html#web-routes-boomerang

Many thanks,

Sem

--
Семен Тригубенко

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk9xvgEACgkQ3zbainCY8elq4QCeKIM8I3YDCIAKqWgMPtlRkO8W
NuYAnjTVpzUSdHwUKNLzczuo4yAPGi1H
=iQjy
-----END PGP SIGNATURE-----

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Happstack routing + boomerang + non-ascii urls

Jeremy Shaw-3
In reply to this post by Semen Trygubenko / Семен Тригубенко
This should be fixed in happstack-server-6.6.5. You will need to rebuild web-routes-happstack as well to get the changes.

Let me know if it works for you! Here is my test app:

http://hpaste.org/66072

- jeremy

On Tue, Mar 27, 2012 at 8:17 AM, Semen Trygubenko <[hidden email]> wrote:
Dear Haskell-Cafe,

Last weekend I was test driving Web.Routes.Boomerang. A
great package … Is there any way I could make it work with
urls containing non-ASCII characters?

Happstack.Server routing using "path" handles non-ASCII,
as in, for instance,

dir "work" $ path $ workHandler ,

where workHandler gets a correctly decoded path segment
passed in as a String. The following, however,

sitemap :: Router Sitemap
sitemap = (
   rWork . anyString
)

passes to Work constructor an incorrectly decoded String.

All the plumbing re embedding boomerang route into a normal
Happstack one, etc. is done as per example from crash course
here:

http://happstack.com/docs/crashcourse/WebRoutes.html#web-routes-boomerang

Many thanks,

Sem

--
Семен Тригубенко

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk9xvgEACgkQ3zbainCY8elq4QCeKIM8I3YDCIAKqWgMPtlRkO8W
NuYAnjTVpzUSdHwUKNLzczuo4yAPGi1H
=iQjy
-----END PGP SIGNATURE-----

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Happstack routing + boomerang + non-ascii urls

Semen Trygubenko / Семен Тригубенко
On Tue, Mar 27, 2012 at 01:13:15PM -0500, Jeremy Shaw wrote:
> This should be fixed in happstack-server-6.6.5. You will need to rebuild
> web-routes-happstack as well to get the changes.
>
> Let me know if it works for you!

It does.

Thank you very much for your kind and swift help.

--
Семен Тригубенко

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe

signature.asc (205 bytes) Download Attachment
Loading...