mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Fix: WebUI port switch reconnect
The WebUI will get now the new port for next reconnect It was necessary to add the Access-Control-Allow-Origin header with a wildcard for file serving
This commit is contained in:
@@ -30,6 +30,7 @@ const QByteArray & QtHttpHeader::Location = QByteArrayLiteral ("Loca
|
||||
const QByteArray & QtHttpHeader::SetCookie = QByteArrayLiteral ("Set-Cookie");
|
||||
const QByteArray & QtHttpHeader::TransferEncoding = QByteArrayLiteral ("Transfer-Encoding");
|
||||
const QByteArray & QtHttpHeader::ContentDisposition = QByteArrayLiteral ("Content-Disposition");
|
||||
const QByteArray & QtHttpHeader::AccessControlAllow = QByteArrayLiteral ("Access-Control-Allow-Origin");
|
||||
const QByteArray & QtHttpHeader::Upgrade = QByteArrayLiteral ("Upgrade");
|
||||
const QByteArray & QtHttpHeader::SecWebSocketKey = QByteArrayLiteral ("Sec-WebSocket-Key");
|
||||
const QByteArray & QtHttpHeader::SecWebSocketProtocol = QByteArrayLiteral ("Sec-WebSocket-Protocol");
|
||||
|
@@ -32,6 +32,7 @@ public:
|
||||
static const QByteArray & SetCookie;
|
||||
static const QByteArray & TransferEncoding;
|
||||
static const QByteArray & ContentDisposition;
|
||||
static const QByteArray & AccessControlAllow;
|
||||
// Websocket specific headers
|
||||
static const QByteArray & Upgrade;
|
||||
static const QByteArray & SecWebSocketKey;
|
||||
|
@@ -135,6 +135,7 @@ void StaticFileServing::onRequestNeedsReply (QtHttpRequest * request, QtHttpRepl
|
||||
if (file.open (QFile::ReadOnly)) {
|
||||
QByteArray data = file.readAll ();
|
||||
reply->addHeader ("Content-Type", mime.name ().toLocal8Bit ());
|
||||
reply->addHeader(QtHttpHeader::AccessControlAllow, "*" );
|
||||
reply->appendRawData (data);
|
||||
file.close ();
|
||||
}
|
||||
|
Reference in New Issue
Block a user