diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f5ac39..f7a55ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ v1.6 - Fix GH-15 Add password import from CSV - Fix FLEXIAPI-242 Add stricter validation for the AccountCreationToken Push Notification endpoint - Fix FLEXIAPI-252 Update the hCaptcha Laravel library, use file instead of cookies to store the session to prevent empty errors bags +- Fix FLEXIAPI-254 Allow no data on POST requests to not trigger the ValidateJSON middleware v1.5 --- diff --git a/flexiapi/app/Http/Middleware/ValidateJSON.php b/flexiapi/app/Http/Middleware/ValidateJSON.php index 0869c69..1155776 100644 --- a/flexiapi/app/Http/Middleware/ValidateJSON.php +++ b/flexiapi/app/Http/Middleware/ValidateJSON.php @@ -11,7 +11,7 @@ class ValidateJSON public function handle(Request $request, Closure $next) { - if ($request->expectsJson()) { + if ($request->expectsJson() && !empty($request->getContent())) { json_decode($request->getContent()); if (json_last_error() !== JSON_ERROR_NONE) { abort(400, self::$message . ': ' . json_last_error_msg());