1// Copyright (C) 2019 Mikhail Svetkin <mikhail.svetkin@gmail.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#include "qhttpserverliterals_p.h"
5
6#include <QtCore/qbytearray.h>
7
8QT_BEGIN_NAMESPACE
9
10// Don't use QByteArrayLiteral, as this library may be unloaded before all
11// references to the data are destroyed - by allocating on the heap, the last
12// user will free the data instead of referencing unloaded data
13
14QByteArray QHttpServerLiterals::contentTypeXEmpty()
15{
16 static QByteArray ba("application/x-empty");
17 return ba;
18}
19
20QByteArray QHttpServerLiterals::contentTypeTextHtml()
21{
22 static QByteArray ba("text/html");
23 return ba;
24}
25
26QByteArray QHttpServerLiterals::contentTypeJson()
27{
28 static QByteArray ba("application/json");
29 return ba;
30}
31
32QT_END_NAMESPACE
33

Provided by KDAB

Privacy Policy
Start learning QML with our Intro Training
Find out more

source code of qthttpserver/src/httpserver/qhttpserverliterals.cpp