Skip to content

Commit 778f009

Browse files
committed
Don't fail when no content-type header present
1 parent 6b19676 commit 778f009

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Middleware/SCIMHeaders.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ class SCIMHeaders
1010
{
1111
public function handle(Request $request, Closure $next)
1212
{
13-
if ($request->method() != 'GET' && stripos($request->header('content-type'), 'application/scim+json') === false && stripos($request->header('content-type'), 'application/json') === false && strlen($request->getContent()) > 0) {
13+
$contentType = $request->header('content-type', '');
14+
15+
if ($request->method() != 'GET' && stripos($contentType, 'application/scim+json') === false && stripos($contentType, 'application/json') === false && strlen($request->getContent()) > 0) {
1416
throw new SCIMException(sprintf('The content-type header should be set to "%s"', 'application/scim+json'));
1517
}
1618

0 commit comments

Comments
 (0)