image server
This commit is contained in:
@@ -451,6 +451,16 @@ class WrenchApi extends BaseController
|
||||
header("Access-Control-Max-Age: 3600");
|
||||
header('content-type: application/json; charset=utf-8');
|
||||
$method = $_SERVER['REQUEST_METHOD'];
|
||||
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
|
||||
$ip_loc = $_SERVER['HTTP_CLIENT_IP'];
|
||||
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||
$ip_loc = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
} else {
|
||||
$ip_loc = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
|
||||
|
||||
if ($method == "OPTIONS") {
|
||||
header("HTTP/1.1 200 OK CORS");
|
||||
log_message('critical', " apigate()-> OPTIONS DIE*****" );
|
||||
@@ -548,6 +558,10 @@ class WrenchApi extends BaseController
|
||||
$out = $local_out;
|
||||
}
|
||||
|
||||
$out["session_image_server"] = "https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1/getmedia/";
|
||||
$out["language"] = "en";
|
||||
$out["ip_loc"] = $ip_loc;
|
||||
|
||||
$this->doCacheStep($in, $out);
|
||||
return json_encode( ( new \App\Models\ResultFormatter() )->processOutJson($in, $out));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user