lib/epom/epom_element.rb in epom-0.10 vs lib/epom/epom_element.rb in epom-0.10.5
- old
+ new
@@ -28,11 +28,10 @@
url_signature = signature[:url]
url_params.symbolize_keys! if url_params.is_a? Hash
body_params.symbolize_keys! if body_params.is_a? Hash
- url = replace_params_in_url(url_signature, url_params)
method = signature[:method]
if signature[:headers]
headers signature[:headers]
else
@@ -53,13 +52,25 @@
body_params[:timestamp] = timestamp
end
if body_params_signature.include?(:username) and not body_params[:username]
body_params[:username] = Epom.config.username
end
+
+ if url_params_signature and url_params_signature.include?(:login) and not url_params[:login]
+ url_params[:login] = Epom.config.username
+ end
+ if url_params_signature and url_params_signature.include?(:hash) and not url_params[:hash]
+ url_params[:hash] = Epom.create_hash(Epom.create_hash(Epom.config.password), timestamp)
+ end
+ if url_params_signature and url_params_signature.include?(:timestamp) and not url_params[:timestamp]
+ url_params[:timestamp] = timestamp
+ end
if params_validation(url_params, url_params_signature) and params_validation(body_params, body_params_signature)
http_proxy Epom.config.proxy_address, Epom.config.proxy_port, Epom.config.proxy_user, Epom.config.proxy_password
base_uri Epom.config.epom_server
+ url = replace_params_in_url(url_signature, url_params)
+
puts method_name
response = send(method, url, :query => body_params)
if response.success?
return response.parsed_response
else
\ No newline at end of file