/trunk/TODO |
---|
1,8 → 1,4 |
June 2023 planned: |
- Test REST API |
- Test if REST API "OPTIONS" is implemented |
May 2023 planned: |
- Don't send "information object OIDs" (= Non-OIDs) OIDs to oid-info.com anymore |
=> 17 May 2023 mitigated at VTS internal side |
/trunk/includes/classes/OIDplusLogger.class.php |
---|
192,7 → 192,7 |
$sev_fixed = $sevs[0]; |
} else if (count($sevs) == 2) { |
$sev_online = $sevs[0]; |
$sev_offline = $sevs[1]; |
$sev_offline = $sevs[1]; /* @phpstan-ignore-line */ |
if (($sev_online == 'NONE') && ($sev_offline == 'NONE')) return false; // meaningless component |
try { self::convertSeverity($sev_online); } catch (\Exception $e) { return false; } // just checking for valid value |
try { self::convertSeverity($sev_offline); } catch (\Exception $e) { return false; } // just checking for valid value |
/trunk/plugins/viathinksoft/publicPages/000_objects/OIDplusPagePublicObjects.class.php |
---|
86,7 → 86,16 |
public function restApiCall(string $requestMethod, string $endpoint, array $json_in) { |
if (str_starts_with($endpoint, 'objects/')) { |
$id = substr($endpoint, strlen('objects/')); |
if ($requestMethod == "GET"/*Select*/) { |
if ($requestMethod == "OPTIONS") { |
header("access-control-allow-credentials: true"); |
header("access-control-allow-headers: Keep-Alive,User-Agent,Authorization"); |
header("access-control-allow-methods: GET, PUT, POST, DELETE, PATCH, OPTIONS"); |
header("access-control-allow-origin: *"); |
http_response_code(204/*No content*/); |
OIDplus::invoke_shutdown(); |
die(); // return array(); |
} |
else if ($requestMethod == "GET"/*Select*/) { |
$obj = OIDplusObject::findFitting($id); |
if (!$obj) throw new OIDplusException(_L('The object %1 was not found in this database.', $id), null, 404); |