57 if (m_pathToContent.endsWith(
'/'))
58 m_pathToContent.chop(1);
59 m_pathToContent += QStringLiteral(
"/html");
61 m_allowedFiles << QStringLiteral(
"/") << QStringLiteral(
"/index.html") << QStringLiteral(
"/torc.xsd") <<
62 QStringLiteral(
"/browserconfig.xml") << QStringLiteral(
"/manifest.json");
76 if (Request.
GetUrl() == QStringLiteral(
"/*"))
84 QString url = Request.
GetUrl();
85 if (m_allowedFiles.contains(url))
87 if (url == QStringLiteral(
"/"))
88 url = QStringLiteral(
"/index.html");
93 else if (url.endsWith(QStringLiteral(
".png"), Qt::CaseInsensitive) || url.endsWith(QStringLiteral(
".ico"), Qt::CaseInsensitive))
virtual void ProcessHTTPRequest(const QString &PeerAddress, int PeerPort, const QString &LocalAddress, int LocalPort, TorcHTTPRequest &Request) override
A class to encapsulate an incoming HTTP request.
HTTPRequestType GetHTTPRequestType(void) const
Base HTTP response handler class.
QString GetTorcShareDir(void)
Return the path to the installed Torc shared resources.
TorcHTMLHandler(const QString &Path, const QString &Name)
static void HandleOptions(TorcHTTPRequest &Request, int Allowed)
static void HandleFile(TorcHTTPRequest &Request, const QString &Filename, int Cache)
void SetStatus(HTTPStatus Status)
void SetResponseType(HTTPResponseType Type)
QString GetUrl(void) const