mirror of
https://github.com/v2board/v2board.git
synced 2024-11-13 02:59: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();
|
$serverService = new ServerService();
|
||||||
$servers = $serverService->getAvailableServers($user);
|
$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([
|
return response([
|
||||||
'data' => $servers
|
'data' => $servers
|
||||||
]);
|
])->header('ETag', "\"{$eTag}\"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,8 @@ class UserController extends Controller
|
|||||||
'u',
|
'u',
|
||||||
'd',
|
'd',
|
||||||
'transfer_enable',
|
'transfer_enable',
|
||||||
'email'
|
'email',
|
||||||
|
'uuid'
|
||||||
])
|
])
|
||||||
->first();
|
->first();
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
|
@ -14,7 +14,6 @@ class ClientRoute
|
|||||||
// Client
|
// Client
|
||||||
$router->get('/subscribe', 'Client\\ClientController@subscribe');
|
$router->get('/subscribe', 'Client\\ClientController@subscribe');
|
||||||
// App
|
// App
|
||||||
$router->get('/app/config', 'Client\\AppController@config');
|
|
||||||
$router->get('/app/getConfig', 'Client\\AppController@getConfig');
|
$router->get('/app/getConfig', 'Client\\AppController@getConfig');
|
||||||
$router->get('/app/getVersion', 'Client\\AppController@getVersion');
|
$router->get('/app/getVersion', 'Client\\AppController@getVersion');
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user