If the request does not have the application/json content type header then return NULL

This commit is contained in:
Alex Tselegidis 2021-10-29 13:08:41 +02:00
parent d886f6db16
commit 8947500968

View file

@ -57,7 +57,7 @@ class EA_Input extends CI_Input {
if ($CI->input->get_request_header('Content-Type') !== 'application/json') if ($CI->input->get_request_header('Content-Type') !== 'application/json')
{ {
throw new RuntimeException('Cannot get JSON attribute from non-JSON content.'); return NULL;
} }
$input_stream = $CI->input->raw_input_stream; $input_stream = $CI->input->raw_input_stream;