Skip to content

Commit

Permalink
优化适配新框架
Browse files Browse the repository at this point in the history
  • Loading branch information
ilovintit committed May 17, 2020
1 parent 6e6fd04 commit 0c25093
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Middleware/VerifyApiSignature.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function subHandle($request, Closure $next)
/*
* 根据请求的路径和请求的随机数进行校验,保证在15分钟内只能请求一次,结合上述时间校验防止回放攻击
*/
$uniqueRequestStr = sha1('/' . $request->path() . "\n" . $request->header('X-Ca-Nonce'));
$uniqueRequestStr = config('tools.api_signature_prefix') . sha1('/' . $request->path() . "\n" . $request->header('X-Ca-Nonce'));
if (cache()->get($uniqueRequestStr)) {
throw new RepeatRequestException();
}
Expand Down

0 comments on commit 0c25093

Please sign in to comment.