Permalink
Browse files

add a trailing slash if necessary

  • Loading branch information...
1 parent 2cf9c76 commit f7ed7332eceaa5f14f2b31d159261b36f35492e7 Andre Lewis committed Oct 3, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 url_monitor/url_monitor.rb
@@ -101,7 +101,13 @@ def http_response(url)
response = h.request(req)
}
rescue Exception => e
- if e.message =~ /execution expired/ and retry_url_execution_expired
+ # forgot the trailing slash...add and retry
+ if e.message == "HTTP request path is empty" and retry_url_trailing_slash
+ url += '/'
+ uri = URI.parse(url)
+ retry_url_trailing_slash = false
+ retry
+ elsif e.message =~ /execution expired/ and retry_url_execution_expired
retry_url_execution_expired = false
retry
else

0 comments on commit f7ed733

Please sign in to comment.