Skip to content

Commit f955093

Browse files
author
Peter Schrammel
committed
addin :timeout for the requests as an option
1 parent c72245b commit f955093

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

README.rdoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ revers_proxy_options set global options for all reverse proxies. Available optio
3535
* :username username for basic auth
3636
* :password password for basic auth
3737
* :matching is a global only option, if set to :first the first matched url will be requested (no ambigous error). Default: :all.
38+
* :timeout seconds to timout the requests
3839
== Note on Patches/Pull Requests
3940

4041
* Fork the project.

lib/rack/reverse_proxy.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def call(env)
2828
session = Net::HTTP.new(uri.host, uri.port)
2929
session.use_ssl = (uri.scheme == 'https')
3030
session.verify_mode = OpenSSL::SSL::VERIFY_NONE
31+
session.read_timeout=all_opts[:timeout] if all_opts[:timeout]
3132
session.start { |http|
3233
m = rackreq.request_method
3334
case m

0 commit comments

Comments
 (0)