Skip to content

Commit 704e125

Browse files
committed
Harden JSON error handling
1 parent a92a3f5 commit 704e125

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ResponseBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ protected function getMockHeadersForRequest(RequestInterface $request): array
183183
try {
184184
$file = $this->getMockFilePathForRequest($request, self::TYPE_HEADERS);
185185

186-
return json_decode(file_get_contents($file), true);
186+
return json_decode(file_get_contents($file), true, 512, JSON_THROW_ON_ERROR);
187187
} catch (MockNotFoundException $e) {
188188
return [];
189189
}

0 commit comments

Comments
 (0)