organic: Enhance external apis
This commit is contained in:
9
www/organic/external/bioqs/operators.php
vendored
9
www/organic/external/bioqs/operators.php
vendored
@@ -1,18 +1,21 @@
|
||||
<?php
|
||||
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header('Content-Type: application/json; charset=UTF-8');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] !== 'GET' && $_SERVER['REQUEST_METHOD'] !== 'HEAD') {
|
||||
header('Status: 405');
|
||||
header('Content-Length: 0');
|
||||
header('Content-Length: 56');
|
||||
header('Allow: GET, HEAD');
|
||||
echo "{\"error\":\"method not allowed\",\"allow\":[\"GET\",\"HEAD\"]}\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$info = $_SERVER['PATH_INFO'];
|
||||
if ($info !== '') {
|
||||
header('Status: 404');
|
||||
header('Content-Length: 0');
|
||||
header('Content-Length: 22');
|
||||
echo "{\"error\":\"not found\"}\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -36,8 +39,6 @@ if (isset($_GET['lfbisNr'])) {
|
||||
$query[] = 'lfbis=' . urlencode($_GET['lfbisNr']);
|
||||
}
|
||||
|
||||
header('Content-Type: application/json; charset=UTF-8');
|
||||
|
||||
echo "{\"data\":";
|
||||
passthru("python3 .operators.py " . escapeshellarg(implode('&', $query)));
|
||||
echo "}\n";
|
||||
|
||||
Reference in New Issue
Block a user