Skip to content

Commit 4219de6

Browse files
committed
Added querystring variables
1 parent 57c31fb commit 4219de6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

redir.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
class Redir < Sinatra::Base
22
get '/' do
3-
redirect "http://localhost:3000"
3+
querystring = params.map{|k,v| "#{CGI.escape(k)}=#{CGI.escape(v)}"}.join("&")
4+
redirect "http://localhost:3000?#{querystring}"
45
end
56
end

0 commit comments

Comments
 (0)