From 79e233955ce335405483b3127ef8f091fb6759f5 Mon Sep 17 00:00:00 2001 From: rrooij Date: Tue, 20 Jul 2021 12:35:32 +0200 Subject: [PATCH] Remove is_local_https predicate Is not needed anymore since we switched off local https --- src/core/api/db_fetch.pl | 6 +----- src/core/api/db_push.pl | 7 +------ src/core/util.pl | 4 +--- src/core/util/http_utils.pl | 6 +----- 4 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/core/api/db_fetch.pl b/src/core/api/db_fetch.pl index 34302f27d..3a88adf29 100644 --- a/src/core/api/db_fetch.pl +++ b/src/core/api/db_fetch.pl @@ -67,10 +67,6 @@ -> Document = _{ repository_head: Repository_Head } ; Document = _{}), - ( is_local_https(URL) - -> Additional_Options = [cert_verify_hook(cert_accept_any)] - ; Additional_Options = []), - remote_pack_url(URL,Pack_URL), http_post(Pack_URL, @@ -79,7 +75,7 @@ [request_header('Authorization'=Authorization), json_object(dict), status_code(Status) - |Additional_Options]), + ]), ( Status = 200 -> Payload_Option = some(Payload) diff --git a/src/core/api/db_push.pl b/src/core/api/db_push.pl index fc2a58eb7..96880cb1f 100644 --- a/src/core/api/db_push.pl +++ b/src/core/api/db_push.pl @@ -153,11 +153,6 @@ % NOTE: What do we do with the remote branch? How do we send it? authorized_push(Authorization, Remote_URL, Payload) :- - - ( is_local_https(Remote_URL) - -> Additional_Options = [cert_verify_hook(cert_accept_any)] - ; Additional_Options = []), - catch( ( % Try TUS protocol (we could check resulting options too for create etc...) remote_tus_url(Remote_URL, TUS_URL), @@ -188,7 +183,7 @@ json_object(dict), timeout(infinite), status_code(Status_Code) - |Additional_Options]), + ]), E, throw(error(communication_failure(E),_))), diff --git a/src/core/util.pl b/src/core/util.pl index 7d333e976..a6f5b056c 100644 --- a/src/core/util.pl +++ b/src/core/util.pl @@ -186,9 +186,7 @@ benchmark/0, % http_utils.pl - basic_authorization/3, - is_local_https/1 - + basic_authorization/3 ]). % note: test_utils is intentionally omitted diff --git a/src/core/util/http_utils.pl b/src/core/util/http_utils.pl index 6954bfd65..a3268995c 100644 --- a/src/core/util/http_utils.pl +++ b/src/core/util/http_utils.pl @@ -1,12 +1,8 @@ :- module(http_utils,[ - basic_authorization/3, - is_local_https/1 + basic_authorization/3 ]). basic_authorization(User,Pass,Authorization) :- format(string(S), "~s:~s", [User, Pass]), base64(S, Base64_Destination_Auth), format(string(Authorization), "Basic ~s", [Base64_Destination_Auth]). - -is_local_https(URL) :- - re_match('^https://127.0.0.1', URL, []).