Add http_response_code to "apiresult" function
This commit is contained in:
parent
a8128d1a00
commit
741e9994d4
|
@ -3,10 +3,8 @@
|
|||
<?php
|
||||
|
||||
$uri = trim($_GET['uri']);
|
||||
if (!preg_match('/^\d+\.\d+\.\d+\.\d+:\d+$/', $uri)) {
|
||||
http_response_code(400);
|
||||
apiresult(['error' => 'The given URI must match IPV4_HOST:PORT scheme']);
|
||||
}
|
||||
if (!preg_match('/^\d+\.\d+\.\d+\.\d+:\d+$/', $uri))
|
||||
apiresult(['error' => 'The given URI must match IPV4_HOST:PORT scheme'], 400);
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, "http://$uri");
|
||||
|
|
Loading…
Reference in New Issue