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::contentTypeHeader()
15{
16 static QByteArray ba("Content-Type");
17 return ba;
18}
19
20QByteArray QHttpServerLiterals::contentTypeXEmpty()
21{
22 static QByteArray ba("application/x-empty");
23 return ba;
24}
25
26QByteArray QHttpServerLiterals::contentTypeTextHtml()
27{
28 static QByteArray ba("text/html");
29 return ba;
30}
31
32QByteArray QHttpServerLiterals::contentTypeJson()
33{
34 static QByteArray ba("application/json");
35 return ba;
36}
37
38QByteArray QHttpServerLiterals::contentLengthHeader()
39{
40 static QByteArray ba("Content-Length");
41 return ba;
42}
43
44QT_END_NAMESPACE
45

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