Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/external_authorization/client.rb')
-rw-r--r--lib/gitlab/external_authorization/client.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/gitlab/external_authorization/client.rb b/lib/gitlab/external_authorization/client.rb
index 7985e6dcf7b..fc859304eab 100644
--- a/lib/gitlab/external_authorization/client.rb
+++ b/lib/gitlab/external_authorization/client.rb
@@ -17,23 +17,28 @@ module Gitlab
end
def request_access
- response = Excon.post(
+ response = Gitlab::HTTP.post(
service_url,
post_params
)
::Gitlab::ExternalAuthorization::Response.new(response)
- rescue Excon::Error => e
+ rescue *Gitlab::HTTP::HTTP_ERRORS => e
raise ::Gitlab::ExternalAuthorization::RequestFailed.new(e)
end
private
+ def allow_local_requests?
+ Gitlab::CurrentSettings.allow_local_requests_from_system_hooks?
+ end
+
def post_params
params = { headers: REQUEST_HEADERS,
body: body.to_json,
connect_timeout: timeout,
read_timeout: timeout,
- write_timeout: timeout }
+ write_timeout: timeout,
+ allow_local_requests: allow_local_requests? }
if has_tls?
params[:client_cert_data] = client_cert