new strategy for surf mode

This commit is contained in:
Kyle Drake 2015-03-26 11:53:41 -07:00
parent 0efa3cada0
commit 75f6c5d31b
6 changed files with 47 additions and 7 deletions

6
app.rb
View file

@ -21,7 +21,13 @@ helpers do
end
end
set :protection, :frame_options => "ALLOW-FROM #{$config['surf_iframe_source']}"
before do
if request.host.match /\w+\.#{Addressable::URI.parse($config['surf_proxy_uri']).host}/i
surf_proxy
end
if request.path.match /^\/api\//i
@api = true
content_type :json