Skip to content

Commit d12deb4

Browse files
author
jneen
committed
redirect to strip paths ending in /
1 parent bd5a485 commit d12deb4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

app.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ class Dingus < Sinatra::Base
9696
erb :index, locals: { demo: demo, flash: nil }
9797
end
9898

99+
# redirect paths ending in /
100+
get %r(.*/) do
101+
redirect to(env['PATH_INFO'].chomp('/'))
102+
end
103+
99104
error 400..500 do
100105
case request.content_type
101106
when 'application/json'

0 commit comments

Comments
 (0)