Replaced all headers-related methods with only setter and getter to make
the class interface simpler and more consistent with other classes
consuming QHttpHeaders.
Resulted from API-review
Task-number: QTBUG-125859
Pick-to: 6.8
Change-Id: Ic41b471813969711bb07302a8929784bc425c84e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Following 74ad4cbeef40b1f51a59b3168f8c0b62eb0b29c8, QMimeDatabase no
longer recognizes an SVG data stream as anything but XML.
Replace the hardcoded mime types. We can only promise that
QHttpServerResponse recognizes mime types as per QMimeDatabase, so
compare with what we get from it.
Fixes: QTBUG-127333
Pick-to: 6.8 6.7 6.5
Change-Id: I902561518c903b7b3e0e57937d472cdbf9c56858
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Added withHeaders() method to pass headers to the QHttpServerResponse object.
Removed methods using QHttpServerResponder::HeaderList because it will be also replaced by QHttpHeaders.
Added headers() method for convenience.
Updated tests and examples.
Fixes: QTBUG-107749
Change-Id: Ia9ce631a17b1b60e84ffc85e09215ac262407144
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Use Q_AUTOTEST_EXPORT for stuff used by the tests.
Mark tst_qhttpser, tst_qhttpserverresponder and
tst_qhttpserverresponse as private because they are using
private APIs.
Task-number: QTBUG-100868
Pick-to: 6.4
Change-Id: I6ecee7ae76fe7e9dc9ab7eceb1ae1c74cc07ef79
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.
Existing copyright statements remain intact
Task-number: QTBUG-88621
Change-Id: I4463e3d03c18748e9a03320261b7f6efcdbd43f8
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
License files are organized under LICENSES directory.
Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I657c36f679b9448ec68d411a492171bc39df1411
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
Remove most of the .pro files used by QMake (except those for examples).
QMake build of Qt modules is not supported anymore.
Also remove .qmake.conf that is not useful anymore.
Change-Id: I3f0af9f09144f3c9ac92d228a318cd515644d48b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Add new API for HTTP headers manipulations.
Add QHttpServerResponse::write function which will
allow to write custom response objects in a future.
Fixes: QTBUG-76933
Change-Id: I744303be1b517c07f698c4a3dd2c4296f77e3b03
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@tqcs.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Currently we have a lot of duplication of most common HTTP headers and their
values.
This patch moves them to one place.
Change-Id: Idf9ddc5164e81649b4cc37ed92a516eb1eedab3a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qbc.io>
This is a shortcut for static file contents.
Change-Id: I54d97c60822e661c1405f27ea8d4598f0363b144
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
QByteArray can be used for any data that QMimeDatabase understands
Change-Id: I17d8f0060065c0a93fc4a8cf6450bdd11aed49d0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>