mirror of
https://github.com/YACReader/yacreader
synced 2025-07-14 11:04:25 -04:00
Move from session based state to client side tokens.
YACReaderHttpSession is still used, but it is not a http session anymore.
This commit is contained in:
@ -16,10 +16,16 @@
|
||||
PageControllerV2::PageControllerV2() {}
|
||||
|
||||
void PageControllerV2::service(HttpRequest& request, HttpResponse& response)
|
||||
{
|
||||
HttpSession session=Static::sessionStore->getSession(request,response,false);
|
||||
YACReaderHttpSession *ySession = Static::yacreaderSessionStore->getYACReaderSessionHttpSession(session.getId());
|
||||
|
||||
{
|
||||
QByteArray token = request.getHeader("x-request-id");
|
||||
YACReaderHttpSession *ySession = Static::yacreaderSessionStore->getYACReaderSessionHttpSession(token);
|
||||
|
||||
if (ySession == nullptr) {
|
||||
response.setStatus(404,"not found");
|
||||
response.write("404 not found",true);
|
||||
return;
|
||||
}
|
||||
|
||||
QString path = QUrl::fromPercentEncoding(request.getPath()).toUtf8();
|
||||
bool remote = path.endsWith("remote");
|
||||
|
||||
|
Reference in New Issue
Block a user