fix #210
This commit is contained in:
parent
e2fc198205
commit
1f3350690a
@ -10,8 +10,8 @@
|
||||
"deviceClasses": [
|
||||
{
|
||||
"deviceClassId": "308ae6e6-38b3-4b3a-a513-3199da2764f8",
|
||||
"name": "Elro Socket (AB440D)",
|
||||
"idName": "socketAB440D",
|
||||
"name": "Elro Socket",
|
||||
"idName": "elroSocket",
|
||||
"createMethods": ["user"],
|
||||
"paramTypes": [
|
||||
{
|
||||
@ -73,204 +73,6 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"deviceClassId": "d29cf309-8a3e-4bcc-90ab-87d1adfb8985",
|
||||
"name": "Elro Bulb (AB440L)",
|
||||
"idName": "bulbAB440L",
|
||||
"createMethods": ["user"],
|
||||
"paramTypes": [
|
||||
{
|
||||
"name": "Name",
|
||||
"type": "QString",
|
||||
"inputType": "TextLine"
|
||||
},
|
||||
{
|
||||
"name": "channel 1",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "channel 2",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "channel 3",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "channel 4",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "channel 5",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "A",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "B",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "C",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "D",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "E",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"actionTypes": [
|
||||
{
|
||||
"id": "31c9758e-6567-4f89-85bb-29e1a7c55d44",
|
||||
"idName": "power",
|
||||
"name": "set power",
|
||||
"paramTypes": [
|
||||
{
|
||||
"name": "power",
|
||||
"type": "bool"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"deviceClassId": "9516c818-7cbe-4ec2-a961-f29d7b918437",
|
||||
"name": "Elro Socket (AB440S)",
|
||||
"idName": "socketAB440S",
|
||||
"createMethods": ["user"],
|
||||
"paramTypes": [
|
||||
{
|
||||
"name": "Name",
|
||||
"type": "QString",
|
||||
"inputType": "TextLine"
|
||||
},
|
||||
{
|
||||
"name": "channel 1",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "channel 2",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "channel 3",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "channel 4",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "channel 5",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "A",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "B",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "C",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "D",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "E",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"actionTypes": [
|
||||
{
|
||||
"id": "31c9758e-6567-4f89-85bb-29e1a7c55d44",
|
||||
"idName": "power",
|
||||
"name": "set power",
|
||||
"paramTypes": [
|
||||
{
|
||||
"name": "power",
|
||||
"type": "bool"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"deviceClassId": "e03adc74-b972-451a-afd5-b562a7ab91cd",
|
||||
"name": "Elro outdoor socket (AB440WD)",
|
||||
"idName": "socketAB440WD",
|
||||
"createMethods": ["user"],
|
||||
"paramTypes": [
|
||||
{
|
||||
"name": "Name",
|
||||
"type": "QString",
|
||||
"inputType": "TextLine"
|
||||
},
|
||||
{
|
||||
"name": "channel 1",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "channel 2",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "channel 3",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "channel 4",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "channel 5",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "A",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "B",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "C",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "D",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "E",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"actionTypes": [
|
||||
{
|
||||
"id": "31c9758e-6567-4f89-85bb-29e1a7c55d44",
|
||||
"idName": "power",
|
||||
"name": "set power",
|
||||
"paramTypes": [
|
||||
{
|
||||
"name": "power",
|
||||
"type": "bool"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -134,12 +134,13 @@ HttpReply::HttpReply(QObject *parent) :
|
||||
m_reasonPhrase = getHttpReasonPhrase(m_statusCode);
|
||||
|
||||
// set known headers
|
||||
setHeader(HttpReply::ContentTypeHeader, "text/plain; charset=\"utf-8\";");
|
||||
setHeader(HttpHeaderType::ServerHeader, "guh/" + QByteArray(GUH_VERSION_STRING));
|
||||
setHeader(HttpHeaderType::DateHeader, QDateTime::currentDateTime().toString("ddd, dd MMM yyyy hh:mm:ss").toUtf8() + " GMT");
|
||||
setRawHeader("Access-Control-Allow-Origin","*");
|
||||
setRawHeader("Keep-Alive", "timeout=6, max=50");
|
||||
setHeader(HttpHeaderType::CacheControlHeader, "no-cache");
|
||||
setHeader(HttpHeaderType::ConnectionHeader, "keep-alive");
|
||||
setHeader(HttpHeaderType::ConnectionHeader, "Keep-Alive");
|
||||
setRawHeader("Access-Control-Allow-Origin","*");
|
||||
setRawHeader("Keep-Alive", "timeout=10, max=50");
|
||||
packReply();
|
||||
}
|
||||
|
||||
@ -156,13 +157,14 @@ HttpReply::HttpReply(const HttpReply::HttpStatusCode &statusCode, const HttpRepl
|
||||
|
||||
m_reasonPhrase = getHttpReasonPhrase(m_statusCode);
|
||||
|
||||
// set known headers
|
||||
// set known / default headers
|
||||
setHeader(HttpReply::ContentTypeHeader, "text/plain; charset=\"utf-8\";");
|
||||
setHeader(HttpHeaderType::ServerHeader, "guh/" + QByteArray(GUH_VERSION_STRING));
|
||||
setHeader(HttpHeaderType::DateHeader, QDateTime::currentDateTime().toString("ddd, dd MMM yyyy hh:mm:ss").toUtf8() + " GMT");
|
||||
setRawHeader("Access-Control-Allow-Origin","*");
|
||||
setRawHeader("Keep-Alive", "timeout=10, max=50");
|
||||
setHeader(HttpHeaderType::CacheControlHeader, "no-cache");
|
||||
setHeader(HttpHeaderType::ConnectionHeader, "Keep-Alive");
|
||||
setRawHeader("Access-Control-Allow-Origin","*");
|
||||
setRawHeader("Keep-Alive", "timeout=10, max=50");
|
||||
packReply();
|
||||
}
|
||||
|
||||
|
||||
@ -156,6 +156,7 @@ HttpReply *DeviceClassesResource::getDeviceClass()
|
||||
{
|
||||
qCDebug(dcRest) << "Get device class with id " << m_deviceClass.id();
|
||||
HttpReply *reply = createSuccessReply();
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(JsonTypes::packDeviceClass(m_deviceClass)).toJson());
|
||||
return reply;
|
||||
}
|
||||
@ -164,6 +165,7 @@ HttpReply *DeviceClassesResource::getActionTypes()
|
||||
{
|
||||
qCDebug(dcRest) << "Get action types for device class" << m_deviceClass.id();
|
||||
HttpReply *reply = createSuccessReply();
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(JsonTypes::packActionTypes(m_deviceClass)).toJson());
|
||||
return reply;
|
||||
}
|
||||
@ -175,6 +177,7 @@ HttpReply *DeviceClassesResource::getActionType(const ActionTypeId &actionTypeId
|
||||
foreach (const ActionType &actionType, m_deviceClass.actionTypes()) {
|
||||
if (actionType.id() == actionTypeId) {
|
||||
HttpReply *reply = createSuccessReply();
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(JsonTypes::packActionType(actionType)).toJson());
|
||||
return reply;
|
||||
}
|
||||
@ -186,6 +189,7 @@ HttpReply *DeviceClassesResource::getStateTypes()
|
||||
{
|
||||
qCDebug(dcRest) << "Get state types for device class" << m_deviceClass.id();
|
||||
HttpReply *reply = createSuccessReply();
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(JsonTypes::packStateTypes(m_deviceClass)).toJson());
|
||||
return reply;
|
||||
}
|
||||
@ -197,6 +201,7 @@ HttpReply *DeviceClassesResource::getStateType(const StateTypeId &stateTypeId)
|
||||
foreach (const StateType &stateType, m_deviceClass.stateTypes()) {
|
||||
if (stateType.id() == stateTypeId) {
|
||||
HttpReply *reply = createSuccessReply();
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(JsonTypes::packStateType(stateType)).toJson());
|
||||
return reply;
|
||||
}
|
||||
@ -208,6 +213,7 @@ HttpReply *DeviceClassesResource::getEventTypes()
|
||||
{
|
||||
qCDebug(dcRest) << "Get event types for device class" << m_deviceClass.id();
|
||||
HttpReply *reply = createSuccessReply();
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(JsonTypes::packEventTypes(m_deviceClass)).toJson());
|
||||
return reply;
|
||||
}
|
||||
@ -219,6 +225,7 @@ HttpReply *DeviceClassesResource::getEventType(const EventTypeId &eventTypeId)
|
||||
foreach (const EventType &eventType, m_deviceClass.eventTypes()) {
|
||||
if (eventType.id() == eventTypeId) {
|
||||
HttpReply *reply = createSuccessReply();
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(JsonTypes::packEventType(eventType)).toJson());
|
||||
return reply;
|
||||
}
|
||||
@ -253,6 +260,7 @@ void DeviceClassesResource::devicesDiscovered(const DeviceClassId &deviceClassId
|
||||
qCDebug(dcRest) << "Discovery finished. Found" << deviceDescriptors.count() << "devices.";
|
||||
|
||||
HttpReply *reply = m_discoverRequests.take(deviceClassId);
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(JsonTypes::packDeviceDescriptors(deviceDescriptors)).toJson());
|
||||
reply->finished();
|
||||
}
|
||||
@ -266,6 +274,7 @@ HttpReply *DeviceClassesResource::getDeviceClasses(const VendorId &vendorId)
|
||||
}
|
||||
|
||||
HttpReply *reply = createSuccessReply();
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(JsonTypes::packSupportedDevices(vendorId)).toJson());
|
||||
return reply;
|
||||
}
|
||||
|
||||
@ -215,6 +215,7 @@ HttpReply *DevicesResource::getConfiguredDevices() const
|
||||
finalDevices.append(deviceMap);
|
||||
}
|
||||
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(finalDevices).toJson());
|
||||
return reply;
|
||||
}
|
||||
@ -229,6 +230,7 @@ HttpReply *DevicesResource::getConfiguredDevice(Device *device) const
|
||||
|
||||
qCDebug(dcRest) << deviceMap;
|
||||
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(deviceMap).toJson());
|
||||
return reply;
|
||||
}
|
||||
@ -237,6 +239,7 @@ HttpReply *DevicesResource::getDeviceStateValues(Device *device) const
|
||||
{
|
||||
qCDebug(dcRest) << "Get states of device with id:" << device->id().toString();
|
||||
HttpReply *reply = createSuccessReply();
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(JsonTypes::packDeviceStates(device)).toJson());
|
||||
return reply;
|
||||
}
|
||||
@ -247,6 +250,7 @@ HttpReply *DevicesResource::getDeviceStateValue(Device *device, const StateTypeI
|
||||
HttpReply *reply = createSuccessReply();
|
||||
QVariantMap stateValueMap;
|
||||
stateValueMap.insert("value", device->state(stateTypeId).value());
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(stateValueMap).toJson());
|
||||
return reply;
|
||||
}
|
||||
@ -333,6 +337,7 @@ HttpReply *DevicesResource::addConfiguredDevice(const QByteArray &payload) const
|
||||
QVariantMap result;
|
||||
result.insert("id", newDeviceId);
|
||||
HttpReply *reply = createSuccessReply();
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(result).toJson());
|
||||
return reply;
|
||||
}
|
||||
@ -373,6 +378,7 @@ HttpReply *DevicesResource::pairDevice(const QByteArray &payload) const
|
||||
returns.insert("pairingTransactionId", pairingTransactionId.toString());
|
||||
returns.insert("setupMethod", JsonTypes::setupMethod().at(deviceClass.setupMethod()));
|
||||
HttpReply *reply = createSuccessReply();
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(returns).toJson());
|
||||
return reply;
|
||||
}
|
||||
@ -468,6 +474,7 @@ void DevicesResource::deviceSetupFinished(Device *device, DeviceManager::DeviceE
|
||||
|
||||
QVariantMap result;
|
||||
result.insert("id", device->id());
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(result).toJson());
|
||||
reply->finished();
|
||||
}
|
||||
@ -499,6 +506,7 @@ void DevicesResource::pairingFinished(const PairingTransactionId &pairingTransac
|
||||
qCDebug(dcRest) << "Pairing device finished successfully";
|
||||
QVariantMap response;
|
||||
response.insert("id", deviceId.toString());
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(response).toJson());
|
||||
reply->setHttpStatusCode(HttpReply::Ok);
|
||||
} else {
|
||||
|
||||
@ -85,6 +85,7 @@ HttpReply *LogsResource::getLogEntries(const QString &filterString)
|
||||
entries.append(JsonTypes::packLogEntry(entry));
|
||||
}
|
||||
HttpReply *reply = createSuccessReply();
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(entries).toJson());
|
||||
return reply;
|
||||
}
|
||||
|
||||
@ -111,6 +111,7 @@ HttpReply *PluginsResource::getPlugins() const
|
||||
{
|
||||
qCDebug(dcRest) << "Get plugins";
|
||||
HttpReply *reply = createSuccessReply();
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(JsonTypes::packPlugins()).toJson());
|
||||
return reply;
|
||||
}
|
||||
@ -121,6 +122,7 @@ HttpReply *PluginsResource::getPlugin(const PluginId &pluginId) const
|
||||
HttpReply *reply = createSuccessReply();
|
||||
foreach (DevicePlugin *plugin, GuhCore::instance()->plugins()) {
|
||||
if (plugin->pluginId() == pluginId) {
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(JsonTypes::packPlugin(plugin)).toJson());
|
||||
return reply;
|
||||
}
|
||||
@ -143,6 +145,7 @@ HttpReply *PluginsResource::getPluginConfiguration(const PluginId &pluginId) con
|
||||
}
|
||||
|
||||
HttpReply *reply = createSuccessReply();
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(configurationParamsList).toJson());
|
||||
return reply;
|
||||
}
|
||||
|
||||
@ -83,18 +83,15 @@ HttpReply *RestResource::createSuccessReply()
|
||||
{
|
||||
HttpReply *reply = new HttpReply(HttpReply::Ok, HttpReply::TypeSync);
|
||||
reply->setPayload("200 Ok");
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
return reply;
|
||||
}
|
||||
|
||||
HttpReply *RestResource::createCorsSuccessReply()
|
||||
{
|
||||
HttpReply *reply = RestResource::createSuccessReply();
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "text/plain");
|
||||
reply->setRawHeader("Accept","application/json");
|
||||
reply->setRawHeader("Allow", "PUT, POST, GET, DELETE, OPTIONS");
|
||||
reply->setRawHeader("Access-Control-Allow-Methods", "PUT, POST, GET, DELETE, OPTIONS");
|
||||
reply->setHeader(HttpReply::ContentLenghtHeader, QByteArray::number(0));
|
||||
reply->setRawHeader("Access-Control-Allow-Headers", "Origin, Content-Type, Accept");
|
||||
reply->setRawHeader("Access-Control-Max-Age", "1728000");
|
||||
return reply;
|
||||
|
||||
@ -159,6 +159,7 @@ HttpReply *RulesResource::getRules(const DeviceId &deviceId) const
|
||||
if (!rule.id().isNull())
|
||||
ruleList.append(rule);
|
||||
}
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(JsonTypes::packRuleDescriptions(ruleList)).toJson());
|
||||
}
|
||||
return reply;
|
||||
@ -172,6 +173,7 @@ HttpReply *RulesResource::getRuleDetails(const RuleId &ruleId) const
|
||||
|
||||
qCDebug(dcRest) << "Get rule details";
|
||||
HttpReply *reply = createSuccessReply();
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(JsonTypes::packRule(rule)).toJson());
|
||||
return reply;
|
||||
}
|
||||
@ -184,7 +186,6 @@ HttpReply *RulesResource::removeRule(const RuleId &ruleId) const
|
||||
|
||||
if (status == RuleEngine::RuleErrorNoError) {
|
||||
HttpReply *reply = createSuccessReply();
|
||||
reply->setHeader(HttpReply::ContentLenghtHeader, "0");
|
||||
return reply;
|
||||
}
|
||||
return createErrorReply(HttpReply::InternalServerError);
|
||||
@ -238,6 +239,7 @@ HttpReply *RulesResource::addRule(const QByteArray &payload) const
|
||||
QVariantMap returns;
|
||||
returns.insert("id", newRuleId.toString());
|
||||
HttpReply *reply = createSuccessReply();
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(returns).toJson());
|
||||
return reply;
|
||||
}
|
||||
|
||||
@ -85,6 +85,7 @@ HttpReply *VendorsResource::getVendors() const
|
||||
foreach (const Vendor &vendor, GuhCore::instance()->supportedVendors()) {
|
||||
vendorsList.append(JsonTypes::packVendor(vendor));
|
||||
}
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(vendorsList).toJson());
|
||||
return reply;
|
||||
}
|
||||
@ -95,6 +96,7 @@ HttpReply *VendorsResource::getVendor(const VendorId &vendorId) const
|
||||
foreach (const Vendor &vendor, GuhCore::instance()->supportedVendors()) {
|
||||
if (vendor.id() == vendorId) {
|
||||
HttpReply *reply = createSuccessReply();
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "application/json; charset=\"utf-8\";");
|
||||
reply->setPayload(QJsonDocument::fromVariant(JsonTypes::packVendor(vendor)).toJson());
|
||||
return reply;
|
||||
}
|
||||
|
||||
@ -358,6 +358,9 @@ void WebServer::readClient()
|
||||
if (file.fileName().endsWith(".css")) {
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "text/css; charset=\"utf-8\";");
|
||||
}
|
||||
if (file.fileName().endsWith(".css")) {
|
||||
reply->setHeader(HttpReply::ContentTypeHeader, "text/css; charset=\"utf-8\";");
|
||||
}
|
||||
reply->setPayload(file.readAll());
|
||||
reply->setClientId(clientId);
|
||||
sendHttpReply(reply);
|
||||
|
||||
Reference in New Issue
Block a user