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

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