Skip to content

Commit

Permalink
优化签名校验逻辑,取消无body请求的content-type校验
Browse files Browse the repository at this point in the history
  • Loading branch information
ilovintit committed Dec 23, 2018
1 parent ca7ee50 commit 6f0e7c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Middleware/VerifyApiSignature.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ public function subHandle($request, Closure $next)
/*
* 强制检查传入的body必须为json格式
*/
if (!$request->isJson()) {
throw new RequestContentTypeInvalidException();
}
if (!$request->wantsJson()) {
throw new AcceptTypeInvalidException();
}
if (!empty($request->getContent()) && empty($request->json())) {
throw new BodyFormatInvalidException();
}
if (!empty($request->getContent()) && !$request->isJson()) {
throw new RequestContentTypeInvalidException();
}
/*
* 检查签名必须的字段
*/
Expand Down

0 comments on commit 6f0e7c7

Please sign in to comment.