rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: "Iñaki Baz Castillo" <ibc@aliax.net>
To: rack-devel@googlegroups.com
Subject: Re: Trouble with Unicode in URLs
Date: Fri, 15 Jan 2010 17:43:12 +0100	[thread overview]
Message-ID: <201001151743.12887.ibc@aliax.net> (raw)
In-Reply-To: <aeb13781-3d7b-4d71-99a0-6392320827c9@e27g2000yqd.googlegroups.com>

El Viernes, 15 de Enero de 2010, Gaius escribió:
> I have a Rails app in which I'd like to use some Unicode URLs:
> 
>     # in routes.rb:
>     map.resources 'proteges', :as => 'protégés', :only => [:index]
> 
> When I go to http://localhost:3000/protégés, I get
> 
>     No route matches "/prot%C3%A9g%C3%A9s" with {:method=>:get}
> 
> That was on Mongrel,

Unicode symbols are not allowed in URL according to its BNF grammar. So the 
client (the web browser in your case) hex-escapes these symbols.

This is: the client is sending a request like:

  GET /prot%C3%A9g%C3%A9s HTTP/1.1

which is correct.

Then the server must hex-unescape it, and this is what you do with your Rack 
middleware :)

Rack by itself doesn't require that the URL must be hex-unescaped before 
passing then to the application, so if a task for your application to do it.



> though I also tried Passenger.

And the same happened? I don't think so as Apache unescapes the URL before 
passing the request to the backend (in this case mod_rack). I've checked it 
before: when a request with hex-escaped URL arrives to Apache it unescapes 
before passing the data to mod_rack so you get the Rack variables hex-
unescaped (you should already see the unicode symbols).

I wonder how is possible your Apache not to unescape the URL before passing it 
to Rack, could you please re-check it? which Apache version do you use?


-- 
Iñaki Baz Castillo <ibc@aliax.net>

  reply	other threads:[~2010-01-15 16:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-15 16:26 Trouble with Unicode in URLs Gaius
2010-01-15 16:43 ` Iñaki Baz Castillo [this message]
2010-01-15 16:46   ` Gaius
2010-01-15 17:03     ` Iñaki Baz Castillo
2010-01-15 17:13       ` Gaius
2010-01-15 17:16         ` Gaius
2010-01-15 17:48           ` Iñaki Baz Castillo
2010-01-15 17:21         ` Gaius
2010-01-15 17:49           ` Iñaki Baz Castillo
2010-01-15 19:23             ` Gaius
2010-01-15 21:08               ` Iñaki Baz Castillo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://groups.google.com/group/rack-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201001151743.12887.ibc@aliax.net \
    --to=rack-devel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).