Check content type header exists before checking its type

This commit is contained in:
Jake Barnby
2022-04-08 23:08:44 +12:00
parent f81e69d7d6
commit 58241d6fe8
+2 -1
View File
@@ -498,7 +498,8 @@ class Builder
$swooleRq = $request->getSwoole();
$swooleRq->post = $args;
// Drop json content type so post args are used directly
if ($swooleRq->header['content-type'] === 'application/json') {
if (\array_key_exists('content-type', $swooleRq->header)
&& $swooleRq->header['content-type'] === 'application/json') {
unset($swooleRq->header['content-type']);
}
$request = new Request($swooleRq);