orthecreedence / wookie

Asynchronous HTTP server in common lisp
http://wookie.lyonbros.com/
MIT License
189 stars 19 forks source link

The route does not support non English URI #52

Closed lu4nx closed 9 years ago

lu4nx commented 10 years ago

For example, the URI is Chinese string:

(defroute (:get "/哈哈") (req res)
  (send-response res :body "hello baby"))

Then requesting the http://localhost/哈哈, and Wookie responsing 404 page:

Route for that resource not found =[.

Because Wookie using the puri package, and that don't support UTF-8 charset:

# code from parser.lisp
137                        (parsed-uri (puri:parse-uri resource))
138                        (path (do-urlencode:urldecode (puri:uri-path parsed-uri) :lenientp t))

Please use https://github.com/archimag/puri-unicode, it supports UTF-8 charset :-)

orthecreedence commented 10 years ago

I would love to integrate puri-unicode, however it doesn't load via quicklisp: https://github.com/quicklisp/quicklisp-projects/issues/528

It seems it's too backwards compatible with puri, making the namespaces clash on the quicklisp build system. I pinged Xach about getting it in quicklisp (ie what needs to happen), and depending on his answer will submit a PR to archimag and hopefully get it added.

I'm not willing to have wookie depend on it unless it's in quicklisp since all it's dependencies are now quicklisp loadable and I don't want people to have to download stuff manually. So you're stuck with boring, non-unicode routes until then =[. I'm leaving the issue open until it's solved one way or another.

You could also switch the :depends-on in wookie's ASD to puri-unicode and run your own version of wookie until puri-unicode is in QL.

Thanks for reporting this, I'm hoping wookie will have unicode routes very soon =].

lu4nx commented 10 years ago

Thanks :-), I'm from China, so I would use some Chinese string is URI in my website

orthecreedence commented 9 years ago

I believe this is fixed. Wookie has integrated the quri library in the latest version, and through my testing it is supporting unicode routes.

If you get a chance, can you pull the latest version of wookie and try again? Thanks!

lu4nx commented 9 years ago

Yes, it can work, great, thanks :-)