Will not 301 to unicode URI #23

kalabiyau opened this Issue Jan 27, 2012 · 1 comment

2 participants

r301 '/ashog.php', '/artists/гоша-ашог'

wil produce:

URI::InvalidURIError: bad URI

Only this will do

r301 '/ashog.php', (URI.parse(URI.encode '/artists/гоша-ашог')).to_s

doubt this problem anymore since 1.9 added decent unicode support

require 'rack/rewrite/rule'

Rack::Rewrite::Rule.new(:r301,'/ashog.php', '/artists/гоша-ашог')

# => <Rack::Rewrite::Rule:0x007f9c39122938 @rule_type=:r301, @from="/ashog.php", @to="/artists/гоша-ашог", @options={}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment