lib/uricp/curl_primitives.rb in uricp-0.0.30 vs lib/uricp/curl_primitives.rb in uricp-0.0.31
- old
+ new
@@ -22,24 +22,28 @@
def curl_command
'curl --fail --silent'
end
def authentication
- "-H X-Auth-Token:#{options['authenticator'].call}" if http_authentication?
+ "-H 'X-Auth-Token:#{options['authenticator'].call}'" if http_authentication?
end
def http_authentication?
options['authenticator']
end
+ def temp_url?
+ from && from.query.to_s.include?('temp_url')
+ end
+
def curl_upload_from(source, destination = to)
- "#{curl_command} #{authentication} -T #{source} #{destination};"
+ "#{curl_command} #{authentication} -T '#{source}' '#{destination}';"
end
def curl_download_to_pipe
- "#{curl_command} #{authentication} #{from} |"
+ "#{curl_command} #{authentication unless temp_url?} '#{from}' |"
end
def curl_manifest(object_manifest, destination = to)
- "#{curl_command} #{authentication} -X PUT -H 'X-Object-Manifest: #{object_manifest}' #{destination} --data-binary ''"
+ "#{curl_command} #{authentication} -X PUT -H 'X-Object-Manifest: #{object_manifest}' '#{destination}' --data-binary ''"
end
end