update: support cf etag

This commit is contained in:
tokumeikoi
2022-03-15 22:40:30 +08:00
parent fc2b4bd422
commit 1111c6f13d
3 changed files with 6 additions and 6 deletions

View File

@ -49,12 +49,12 @@ class ShadowsocksTidalabController extends Controller
]);
}
$eTag = sha1(json_encode($result));
if ($eTag === $request->header("IF-NONE-MATCH")) {
if (strpos($request->header('If-None-Match'), $eTag) !== false ) {
abort(304);
}
return response([
'data' => $result
])->header('ETag', $eTag);
])->header('ETag', "\"{$eTag}\"");
}
// 后端提交数据