public
Fork of bmizerany/sinatra
Description: Classy web-development dressed in a DSL
Homepage: http://sinatrarb.com
Clone URL: git://github.com/JackDanger/sinatra.git
filter on host
Blake Mizerany (author)
Tue Apr 01 18:20:52 -0700 2008
commit  d71fe8303dccad05c3e212a463cdd3f6e87e6105
tree    e7a81999d5b8ae88154f4be69953e999f2a3f951
parent  370bda3e533e0e698875973a5d88bbe01048f234
...
160
161
162
163
164
 
 
165
166
 
 
 
167
168
169
...
160
161
162
 
 
163
164
165
166
167
168
169
170
171
172
0
@@ -160,10 +160,13 @@ module Sinatra
0
         
0
     def invoke(request)
0
       params = {}
0
- if options[:agent]
0
- return unless request.user_agent =~ options[:agent]
0
+ if agent = options[:agent]
0
+ return unless request.user_agent =~ agent
0
         params[:agent] = $~[1..-1]
0
       end
0
+ if host = options[:host]
0
+ return unless host === request.host
0
+ end
0
       return unless pattern =~ request.path_info.squeeze('/')
0
       params.merge!(param_keys.zip($~.captures.map(&:from_param)).to_hash)
0
       Result.new(block, params, 200)

Comments

    No one has commented yet.