mirror of
https://github.com/YACReader/yacreader
synced 2025-07-17 20:44:32 -04:00
Separate v1 and v2 server api classes and execution path.
This commit is contained in:
@ -0,0 +1,26 @@
|
||||
#include "errorcontroller_v2.h"
|
||||
|
||||
#include "template.h"
|
||||
#include "../static.h"
|
||||
|
||||
|
||||
ErrorControllerV2::ErrorControllerV2(int errorCode)
|
||||
:error(errorCode)
|
||||
{}
|
||||
|
||||
void ErrorControllerV2::service(HttpRequest& request, HttpResponse& response)
|
||||
{
|
||||
Q_UNUSED(request)
|
||||
switch(error)
|
||||
{
|
||||
case 300:
|
||||
response.setStatus(300,"redirect");
|
||||
response.write("<html> <head> <meta http-equiv=\"refresh\" content=\"0; URL=/\"> </head> <body> </body> </html>", true);
|
||||
break;
|
||||
case 404:
|
||||
response.setStatus(404,"not found");
|
||||
response.write("404 not found",true);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user