update: add etag

This commit is contained in:
tokumeikoi
2022-03-15 21:45:15 +08:00
parent d76c2b3bca
commit fc2b4bd422
3 changed files with 15 additions and 3 deletions

View File

@ -48,9 +48,13 @@ class ShadowsocksTidalabController extends Controller
'secret' => $user->uuid
]);
}
$eTag = sha1(json_encode($result));
if ($eTag === $request->header("IF-NONE-MATCH")) {
abort(304);
}
return response([
'data' => $result
]);
])->header('ETag', $eTag);
}
// 后端提交数据