mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 17:49:11 +08:00
update: support cf etag
This commit is contained in:
parent
fc2b4bd422
commit
1111c6f13d
@ -56,13 +56,13 @@ class DeepbworkController extends Controller
|
|||||||
array_push($result, $user);
|
array_push($result, $user);
|
||||||
}
|
}
|
||||||
$eTag = sha1(json_encode($result));
|
$eTag = sha1(json_encode($result));
|
||||||
if ($eTag === $request->header("IF-NONE-MATCH")) {
|
if (strpos($request->header('If-None-Match'), $eTag) !== false ) {
|
||||||
abort(304);
|
abort(304);
|
||||||
}
|
}
|
||||||
return response([
|
return response([
|
||||||
'msg' => 'ok',
|
'msg' => 'ok',
|
||||||
'data' => $result,
|
'data' => $result,
|
||||||
])->header('ETag', $eTag);
|
])->header('ETag', "\"{$eTag}\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 后端提交数据
|
// 后端提交数据
|
||||||
|
@ -49,12 +49,12 @@ class ShadowsocksTidalabController extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
$eTag = sha1(json_encode($result));
|
$eTag = sha1(json_encode($result));
|
||||||
if ($eTag === $request->header("IF-NONE-MATCH")) {
|
if (strpos($request->header('If-None-Match'), $eTag) !== false ) {
|
||||||
abort(304);
|
abort(304);
|
||||||
}
|
}
|
||||||
return response([
|
return response([
|
||||||
'data' => $result
|
'data' => $result
|
||||||
])->header('ETag', $eTag);
|
])->header('ETag', "\"{$eTag}\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 后端提交数据
|
// 后端提交数据
|
||||||
|
@ -53,13 +53,13 @@ class TrojanTidalabController extends Controller
|
|||||||
array_push($result, $user);
|
array_push($result, $user);
|
||||||
}
|
}
|
||||||
$eTag = sha1(json_encode($result));
|
$eTag = sha1(json_encode($result));
|
||||||
if ($eTag === $request->header("IF-NONE-MATCH")) {
|
if (strpos($request->header('If-None-Match'), $eTag) !== false ) {
|
||||||
abort(304);
|
abort(304);
|
||||||
}
|
}
|
||||||
return response([
|
return response([
|
||||||
'msg' => 'ok',
|
'msg' => 'ok',
|
||||||
'data' => $result,
|
'data' => $result,
|
||||||
])->header('ETag', $eTag);
|
])->header('ETag', "\"{$eTag}\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 后端提交数据
|
// 后端提交数据
|
||||||
|
Loading…
Reference in New Issue
Block a user