mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 01:58:07 +00:00
Fix FLEXIAPI-254 Allow no data on POST requests to not trigger the ValidateJSON middleware
This commit is contained in:
parent
e761e03309
commit
0dcb74ef19
3 changed files with 3 additions and 1 deletions
|
|
@ -10,6 +10,7 @@ v1.7
|
|||
- Fix FLEXIAPI-244 Remove faulty middleware
|
||||
- Fix FLEXIAPI-250 Allow Spaces to be declared without a subdomain
|
||||
- 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.6
|
||||
----
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ use App\Rules\PnProvider;
|
|||
use App\Rules\CallId;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class PushNotificationController extends Controller
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue