lib/cachai.rb in cachai-0.2.0 vs lib/cachai.rb in cachai-0.2.1
- old
+ new
@@ -69,10 +69,10 @@
post '/comments.?:format?' do
begin
data = params[:format] == 'json' ? JSON.parse(request.body.read) : params
if data[:url] # got single URL with protocol://domain/path
- url = URI.parse(data)
+ url = URI.parse(data[:url])
data['domain'] = url.host
data['protocol'] = url.schema
data['path'] = url.path
end