Skip to content

Commit ada3ace

Browse files
authored
Allow 'http://localhost' in URL for apiCall( )
1 parent b5b8526 commit ada3ace

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Basic.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public static function view($view, $data=NULL)
120120

121121
public static function apiCall($http_method, $url, $data=NULL, $user_token=NULL)
122122
{
123-
if ( substr( strtolower( trim($url) ), 0, 8) !== 'https://' ) self::apiResponse(400, 'API URL should start with "https://".'); // Require HTTPS API URL
123+
if ( substr( strtolower( trim($url) ), 0, 16) !== 'http://localhost' && substr( strtolower( trim($url) ), 0, 8) !== 'https://' ) self::apiResponse(400, 'API URL should start with "https://".'); // Require HTTPS API URL
124124

125125
$auth_scheme = ( stristr($user_token, ':') ) ? 'Basic' : 'Bearer'; // Authorization scheme
126126
$auth_cred = ( $auth_scheme === 'Basic' ) ? base64_encode($user_token) : $user_token; // Credentials

0 commit comments

Comments
 (0)