1
0
Fork 0
mirror of synced 2024-10-03 02:37:40 +13:00

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
No known key found for this signature in database
GPG key ID: A4674EBC0E404657

View file

@ -498,7 +498,8 @@ class Builder
$swooleRq = $request->getSwoole(); $swooleRq = $request->getSwoole();
$swooleRq->post = $args; $swooleRq->post = $args;
// Drop json content type so post args are used directly // 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']); unset($swooleRq->header['content-type']);
} }
$request = new Request($swooleRq); $request = new Request($swooleRq);