Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
makuchaku committed Aug 16, 2011
1 parent 0aa674e commit ebcaf47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bridge.rb
Expand Up @@ -5,6 +5,7 @@
#require 'net/https' #require 'net/https'
require 'json' require 'json'



get '/' do get '/' do
headers = params['h'] ? JSON.parse(params['h']) : {} headers = params['h'] ? JSON.parse(params['h']) : {}
url = URI.parse(params['u']) url = URI.parse(params['u'])
Expand Down Expand Up @@ -35,6 +36,6 @@
http.request(request) http.request(request)
end end


arg = "{ status: #{response.code}, headers: [#{response.each_name { }.to_json}], body: '#{response.body}' }" arg = "{ status: #{response.code}, headers: [#{response.each_name { }.to_json}], body: \"#{URI.escape(response.body)}\" }"
json = "#{params['jsonp']}(#{arg});" json = "#{params['jsonp']}(#{arg});"
end end

0 comments on commit ebcaf47

Please sign in to comment.