Permalink
Browse files

Minor fixes

  • Loading branch information...
1 parent 0aa674e commit ebcaf479e18281c96a642d9654bf3a96c8f6c483 makuchaku committed Aug 16, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 bridge.rb
View
3 bridge.rb
@@ -5,6 +5,7 @@
#require 'net/https'
require 'json'
+
get '/' do
headers = params['h'] ? JSON.parse(params['h']) : {}
url = URI.parse(params['u'])
@@ -35,6 +36,6 @@
http.request(request)
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});"
end

0 comments on commit ebcaf47

Please sign in to comment.