lib/fastly/client.rb in fastly-1.6.1 vs lib/fastly/client.rb in fastly-1.7.0
- old
+ new
@@ -100,9 +100,14 @@
return post("/purge/#{url}", params) if @oldpurge
extras = params.delete(:headers) || {}
uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
+
+ if uri.is_a? URI::HTTPS
+ http.use_ssl = true
+ end
+
resp = http.request Net::HTTP::Purge.new(uri.request_uri, headers(extras))
fail Error, resp.body unless resp.kind_of?(Net::HTTPSuccess)
JSON.parse(resp.body)
end