mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 09:39:10 +08:00
update: server etag
This commit is contained in:
parent
56a6025ef9
commit
2930f1957c
@ -26,8 +26,14 @@ class ServerController extends Controller
|
||||
$serverService = new ServerService();
|
||||
$servers = $serverService->getAvailableServers($user);
|
||||
}
|
||||
|
||||
$eTag = sha1(json_encode(array_column($servers, 'updated_at')));
|
||||
if (strpos($request->header('If-None-Match'), $eTag) !== false ) {
|
||||
abort(304);
|
||||
}
|
||||
|
||||
return response([
|
||||
'data' => $servers
|
||||
]);
|
||||
])->header('ETag', "\"{$eTag}\"");
|
||||
}
|
||||
}
|
||||
|
@ -113,7 +113,8 @@ class UserController extends Controller
|
||||
'u',
|
||||
'd',
|
||||
'transfer_enable',
|
||||
'email'
|
||||
'email',
|
||||
'uuid'
|
||||
])
|
||||
->first();
|
||||
if (!$user) {
|
||||
|
@ -14,7 +14,6 @@ class ClientRoute
|
||||
// Client
|
||||
$router->get('/subscribe', 'Client\\ClientController@subscribe');
|
||||
// App
|
||||
$router->get('/app/config', 'Client\\AppController@config');
|
||||
$router->get('/app/getConfig', 'Client\\AppController@getConfig');
|
||||
$router->get('/app/getVersion', 'Client\\AppController@getVersion');
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user