Skip to content

Commit 68b8332

Browse files
limingxinleohuangzhhui
authored andcommitted
fix stripos() expects parameter 1 to be string, array given (swoft-cloud/swoft-component#140)
1 parent 31e4eb9 commit 68b8332

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Server/Concerns/InteractsWithInput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function json(string $key = null, $default = null)
137137
{
138138
try {
139139
$contentType = $this->getHeader('content-type');
140-
if (!$contentType || false === \stripos($contentType, 'application/json')) {
140+
if (!$contentType || false === \stripos($contentType[0], 'application/json')) {
141141
throw new \InvalidArgumentException(sprintf('Invalid Content-Type of the request, expects %s, %s given', 'application/json', ($contentType ? current($contentType) : 'null')));
142142
}
143143
$body = $this->getBody();

0 commit comments

Comments
 (0)