40 m_pathToContent(QStringLiteral(
""))
43 if (m_pathToContent.endsWith(
'/'))
44 m_pathToContent.chop(1);
45 m_pathToContent += QStringLiteral(
"/html");
65 QString subpath = Request.
GetUrl();
70 if (subpath == QStringLiteral(
"/js/torcconfiguration.js"))
95 strings.insert(QStringLiteral(
"TorcRealm"),
TORC_REALM);
101 QJsonObject json = QJsonObject::fromVariantMap(strings);
102 QByteArray result(
"var torc = ");
103 result.append(QJsonDocument(json).toJson());
104 if (result.endsWith(
"\n"))
106 result.append(
";\r\n\r\nif (Object.freeze) { Object.freeze(torc); }\r\n");
A class to encapsulate an incoming HTTP request.
#define TORC_ROOT_SETTING
HTTPRequestType GetHTTPRequestType(void) const
#define TORC_SETTINGS_DIR
Base HTTP response handler class.
#define TORC_PORT_SERVICE
#define TORC_SERVICES_DIR
QString GetTorcShareDir(void)
Return the path to the installed Torc shared resources.
#define TORC_USER_SERVICE
void ProcessHTTPRequest(const QString &PeerAddress, int PeerPort, const QString &LocalAddress, int LocalPort, TorcHTTPRequest &Request) override
static void HandleOptions(TorcHTTPRequest &Request, int Allowed)
void SetResponseContent(const QByteArray &Content)
void SetAllowGZip(bool Allowed)
Allow gzip compression for the contents of this request.
static void HandleFile(TorcHTTPRequest &Request, const QString &Filename, int Cache)
void SetStatus(HTTPStatus Status)
static QVariantMap GetTorcStrings(void)
Return a map of string constants and their translations.
void SetResponseType(HTTPResponseType Type)
QString GetUrl(void) const
static void GetJavascriptConfiguration(TorcHTTPRequest &Request)
Construct a Javascript object that encapsulates Torc variables, enumerations and translated strings...