minad / olelo

Wiki with git backend
MIT License
241 stars 44 forks source link

visiting unknown pages with spaces in the name produces a blank page #4

Closed cout closed 14 years ago

cout commented 14 years ago

Instead of the usual redirect to /new, visiting a page with a space in the name, e.g.:

http://localhost:9454/Foo%20Bar

produces a blank page:

The above text after the colon is a blank page that I've pasted in here. :)

Stdout contains the message:

[2010-02-04 17:56:10] ERROR URI::InvalidURIError: bad URI(is not URI?): http://localhost:9454/Foo Bar/new /usr/lib64/ruby/1.8/uri/generic.rb:732:in merge' /usr/lib64/ruby/1.8/webrick/httpresponse.rb:164:insetup_header' /usr/lib64/ruby/1.8/webrick/httpresponse.rb:102:in send_response' /usr/lib64/ruby/1.8/webrick/httpserver.rb:79:inrun' /usr/lib64/ruby/1.8/webrick/server.rb:173:in start_thread' /usr/lib64/ruby/1.8/webrick/server.rb:162:instart' /usr/lib64/ruby/1.8/webrick/server.rb:162:in start_thread' /usr/lib64/ruby/1.8/webrick/server.rb:95:instart' /usr/lib64/ruby/1.8/webrick/server.rb:92:in each' /usr/lib64/ruby/1.8/webrick/server.rb:92:instart' /usr/lib64/ruby/1.8/webrick/server.rb:23:in start' /usr/lib64/ruby/1.8/webrick/server.rb:82:instart' /usr/lib64/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb:14:in run' /usr/lib64/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:155:instart' /usr/lib64/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:83:in start' /usr/lib64/ruby/gems/1.8/gems/rack-1.1.0/bin/rackup:4 /usr/bin/rackup:19:inload' /usr/bin/rackup:19

I believe git-wiki should be redirecting to:

http://localhost:9454/Foo%20Bar/new

instead of:

http://localhost:9454/Foo Bar/new

but my blindly modifying git-wiki to call uri_escape prevented uri's like:

http://localhost:9454/Foo/Bar Baz

from working.

minad commented 14 years ago

fixed. now works with webrick