@@ -151,7 +151,7 @@ function fetchAccessToken() {
151151 curl_setopt ( $ ch , CURLOPT_USERAGENT , $ this ->gUserAgent );
152152
153153 curl_setopt ( $ ch , CURLOPT_HEADER , 0 );
154- $ this -> setCurlHttpHeaders ( $ ch );
154+ WbstackMagnusOauth:: setCurlHttpHeaders ( $ ch );
155155
156156 curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , 1 );
157157 $ data = curl_exec ( $ ch );
@@ -242,24 +242,6 @@ function sign_request( $method, $url, $params = [] ) {
242242 return base64_encode ( hash_hmac ( 'sha1 ' , $ toSign , $ key , true ) );
243243 }
244244
245- /**
246- * Set the HTTP Headers for the curl handle
247- *
248- * Sets the HOST parameter when internally talking to wbstack platform ingress
249- *
250- */
251- function setCurlHttpHeaders ( $ curlHandle , $ headers = [] ) {
252-
253- if ( WbstackMagnusOauth::isLocalHost () ) {
254- $ domain = $ _SERVER ['SERVER_NAME ' ];
255- $ headers [] = 'HOST: ' . $ domain ;
256- }
257-
258- if ( !empty ($ headers ) ) {
259- curl_setopt ( $ curlHandle , CURLOPT_HTTPHEADER , $ headers );
260- }
261- }
262-
263245 /**
264246 * Request authorization
265247 * @return void
@@ -292,7 +274,7 @@ function doAuthorizationRedirect($callback='') {
292274 //curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
293275 curl_setopt ( $ ch , CURLOPT_USERAGENT , $ this ->gUserAgent );
294276 curl_setopt ( $ ch , CURLOPT_HEADER , 0 );
295- $ this -> setCurlHttpHeaders ( $ ch );
277+ WbstackMagnusOauth:: setCurlHttpHeaders ( $ ch );
296278 curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , 1 );
297279 $ data = curl_exec ( $ ch );
298280 if ( !$ data ) {
@@ -509,7 +491,7 @@ function doApiQuery( $post, &$ch = null , $mode = '' , $iterations_left = 5 , $l
509491 curl_setopt ( $ ch , CURLOPT_USERAGENT , $ this ->gUserAgent );
510492
511493 curl_setopt ( $ ch , CURLOPT_HEADER , 0 );
512- $ this -> setCurlHttpHeaders ( $ ch , [ $ header ] );
494+ WbstackMagnusOauth:: setCurlHttpHeaders ( $ ch , [ $ header ] );
513495
514496 curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , 1 );
515497
0 commit comments