Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #449 from elisehuard/master

trailing slashes at the end of resque servers' URLs
  • Loading branch information...
commit af5a9a8e501c3732100b4ec768f7b2a4ec2aec2e 2 parents 7bc421a + 8031b71
@defunkt defunkt authored
Showing with 17 additions and 11 deletions.
  1. +11 −11 lib/resque/server.rb
  2. +6 −0 test/resque-web_test.rb
View
22 lib/resque/server.rb
@@ -149,21 +149,21 @@ def show_for_polling(page)
end
%w( overview workers ).each do |page|
- get "/#{page}.poll" do
+ get "/#{page}.poll/?" do
show_for_polling(page)
end
- get "/#{page}/:id.poll" do
+ get "/#{page}/:id.poll/?" do
show_for_polling(page)
end
end
%w( overview queues working workers key ).each do |page|
- get "/#{page}" do
+ get "/#{page}/?" do
show page
end
- get "/#{page}/:id" do
+ get "/#{page}/:id/?" do
show page
end
end
@@ -173,7 +173,7 @@ def show_for_polling(page)
redirect u('queues')
end
- get "/failed" do
+ get "/failed/?" do
if Resque::Failure.url
redirect Resque::Failure.url
else
@@ -193,7 +193,7 @@ def show_for_polling(page)
redirect u('failed')
end
- get "/failed/requeue/:index" do
+ get "/failed/requeue/:index/?" do
Resque::Failure.requeue(params[:index])
if request.xhr?
return Resque::Failure.all(params[:index])['retried_at']
@@ -202,24 +202,24 @@ def show_for_polling(page)
end
end
- get "/failed/remove/:index" do
+ get "/failed/remove/:index/?" do
Resque::Failure.remove(params[:index])
redirect u('failed')
end
- get "/stats" do
+ get "/stats/?" do
redirect url_path("/stats/resque")
end
- get "/stats/:id" do
+ get "/stats/:id/?" do
show :stats
end
- get "/stats/keys/:key" do
+ get "/stats/keys/:key/?" do
show :stats
end
- get "/stats.txt" do
+ get "/stats.txt/?" do
info = Resque.info
stats = []
View
6 test/resque-web_test.rb
@@ -51,3 +51,9 @@
should_respond_with_success
end
+
+context "also works with slash at the end" do
+ setup { get "/working/" }
+
+ should_respond_with_success
+end
Please sign in to comment.
Something went wrong with that request. Please try again.