Skip to content

Commit

Permalink
Fix rewrite path info ordering...
Browse files Browse the repository at this point in the history
  • Loading branch information
godfat committed Sep 23, 2018
1 parent 3bbce73 commit 25a316e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/jellyfish/rewrite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
module Jellyfish
class Rewrite < Struct.new(:app, :to)
def call env
app.call(env.merge('PATH_INFO' => "#{env['PATH_INFO']}#{to}"))
app.call(env.merge('PATH_INFO' => "#{to}#{env['PATH_INFO']}"))
end
end
end
2 changes: 1 addition & 1 deletion test/test_rewrite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def call app, path
end
end

expect(call(app, '/from')).eq '/to'
expect(call(app, '/from/here')).eq '/to/here'
end

would 'rewrite and fallback' do
Expand Down

0 comments on commit 25a316e

Please sign in to comment.