summaryrefslogtreecommitdiffstats
path: root/src/network/access/qnetworkrequest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QNetworkRequest: fix minor typo referencing non-existent methodDheerendra Purohit2025-05-291-1/+1
| | | | | | | | | | Replaced incorrect setTimeout() with setTransferTimeout() Pick-to: 6.9 6.8 Fixes: QTBUG-111993 Change-Id: I1eef02cda1be00d6ab99769f4a9b4406ac92d389 Reviewed-by: Mårten Nordheim <[email protected]> Reviewed-by: Giuseppe D'Angelo <[email protected]>
* Document that QNetworkRequest::setRawHeader() lowercases header namesJuha Vuolle2024-12-031-0/+3
| | | | | | | Pick-to: 6.8 Fixes: QTBUG-131474 Change-Id: I3637fb989000cdb991969aa46b9552e52dacad49 Reviewed-by: Mårten Nordheim <[email protected]>
* Create qdoc macros for C++ class docs 1.2: member-swap(), simplified phrasingMarc Mutz2024-11-081-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have some patterns for how to document certain functions, but we also vary the sentences a lot, and you have to look up one documentation piece and copy it, essentially. If we ever want to change them, we end up with shotgun surgery. So apply DRY to the documentation and start a collection of macros to help with repetitive C++ class documentation tasks. The first macro is for member-swap(), and this second patch is for documentation that used the simplified phrasing ("Swaps this X with \a other."), which this patch adopts as the text for \memberswap, too, because it doesn't repeat the macro argument, making it easier to find a grammatically-fitting argument than in the traditional phrasing. This doesn't change the documentation, except as follows: * standardizes on simpified instead of traditional phrasing for docs that already use the \memberswap macro * adds the "very fast and never fails" blurb, if it was missing * changes the function's argument name to `other`, as required by the macro. Task-number: QTBUG-129573 Pick-to: 6.8 6.7 6.5 6.2 Change-Id: I1123e783ce0da76c5997ff74007d77504ac5b334 Reviewed-by: Topi Reiniö <[email protected]> Reviewed-by: Ivan Solovev <[email protected]>
* QNetworkRequest: document the new saturation behavior of transferTimeout()Marc Mutz2024-08-281-1/+4
| | | | | | Pick-to: 6.8 Change-Id: I1b8b57c76f41e36ad14fff9c52f0c346f83426ed Reviewed-by: Mårten Nordheim <[email protected]>
* Network: Add a note about ReasonPhrase not being available in h2Mårten Nordheim2024-06-141-1/+2
| | | | | | | | | | It's always been like this, but the documentation never said so. See https://github.com/httpwg/http2-spec/issues/202 for why. Task-number: QTBUG-126278 Pick-to: 6.8 6.7 6.5 Change-Id: Ie83b105dd78fc1c6c09db46ae8cb5e113cd8a062 Reviewed-by: Mate Barany <[email protected]>
* Http: Add support for full localsocket pathsMårten Nordheim2024-05-241-0/+10
| | | | | | | | | | [ChangeLog][QtNetwork][QNetworkAccessManager] QNetworkAccessManager now supports using full local server name, as in, named pipes on Windows or path to socket objects on Unix. Task-number: QTBUG-102855 Change-Id: Ifc743f5025b3d8d0b558ecffff437881897915d9 Reviewed-by: Timur Pocheptsov <[email protected]>
* Use QHttpHeaders: Update internal users of QNRequest, QNReply, QNProxyLena Biliaieva2024-05-071-126/+299
| | | | | | | | | | | | | Replace QNetworkHeadersPrivate's main headers storage, which was RawHeadersList, with QHttpHeaders. Replace internal usage of raw and cooked header methods with the QHttpHeaders API. [ChangeLog][QtNetwork][QNetworkRequest] Header value added by QNetworkRequest::setRawHeader() method is trimmed now. Task-number: QTBUG-107751 Change-Id: I8882978afa430651e6c798a4fed00beef6c4cfd2 Reviewed-by: Juha Vuolle <[email protected]>
* Add QHttpHeaders methods to QNetworkCacheMetaDataLena Biliaieva2024-05-021-0/+53
| | | | | | | | | | | [ChangeLog][QtNetwork][QNetworkCacheMetaData] Added headers() and setHeaders() methods to QNetworkCacheMetaData to provide an interface to work with QHttpHeaders. Task-number: QTBUG-107751 Change-Id: I1dfed5c2e03f4912de0da96156425cd6b713c1d5 Reviewed-by: Mårten Nordheim <[email protected]> Reviewed-by: Juha Vuolle <[email protected]>
* Add QHttpHeaders to QNetworkRequestLena Biliaieva2024-04-291-0/+66
| | | | | | | | | | | | Added headers() and setHeaders() methods to QNetworkRequest. [ChangeLog][QtNetwork][QNetworkRequest] Added headers() and setHeaders() methods to QNetworkRequest, which provide an interface to work with QHttpHeaders. Task-number: QTBUG-107751 Change-Id: I2e1dc7cb2efab5903eb7ff23b75d01aefe13273d Reviewed-by: Mårten Nordheim <[email protected]>
* Inline old QNetworkRequest transferTimeout int overloadsJuha Vuolle2024-02-141-8/+2
| | | | | | | | | | | Qt 6.7 introduced new std::chrono variants of the transfer timeout functions. We can now inline the old 'int milliseconds' functions to reduce the number of DLL entry points when one isn't needed. Task-number: QTBUG-122023 Change-Id: Iedcb6d0035bc6c3f03b87de543e9b02937b755e6 Reviewed-by: Mårten Nordheim <[email protected]>
* Change QNetworkRequest/Reply rawHeader functions to take QASVJuha Vuolle2024-01-301-4/+5
| | | | | | | | | | | | | | | | | QHttpHeaders uses QASV for the header name field, and this aligns these functions with that. Furthermore having QASV as a parameter will allow a wider range of string types to be passed as a parameter (convenience). Resulted from API-review Amends: 56bb4ac484adb544925b6d7b58e4fd1d77d49503 Pick-to: 6.7 Change-Id: Iff42b75393b6470a2c34a1913dbe615bf21238db Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Mårten Nordheim <[email protected]> Reviewed-by: Marc Mutz <[email protected]>
* QNetworkRequest: export the static constexpr (inline) member variablesThiago Macieira2024-01-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All that is required is that we write the declaration as if they weren't inline, like we used to for C++98 non-constexpr static members. Amends 090991123dd82796fe956e4153bc26ace22280ca. This is required with MinGW and happens with both GCC and Clang: when a static constexpr variable found in an exported class is used in a context that requires getting its address, the compiler emit a DLL- importing statement. For example: void f(const std::chrono::milliseconds &ms); void f() { f(QNetworkRequest::DefaultTransferTimeout); } Emits with GCC: _Z1fv: movq __imp__ZN15QNetworkRequest22DefaultTransferTimeoutE(%rip), %rcx jmp _Z1fRKNSt6chrono8durationIxSt5ratioILx1ELx1000EEEE And Clang: _Z1fv: # @_Z1fv # %bb.0: movq __imp__ZN15QNetworkRequest22DefaultTransferTimeoutE(%rip), %rcx jmp _Z1fRKNSt6chrono8durationIxSt5ratioILx1ELx1000EEEE # TAILCALL Pick-to: 6.7 Fixes: QTBUG-121135 Change-Id: I76ffba14ece04f24b43efffd17aae1a98071c570 Reviewed-by: Juha Vuolle <[email protected]> Reviewed-by: André Klitzing <[email protected]> Reviewed-by: Mårten Nordheim <[email protected]>
* Make QNetworkRequest::KnownHeaders a Q_ENUMMarc Mutz2023-12-091-0/+2
| | | | | | | | | | | | ... so QDebug e.g. stringyifies it automatically. Requires making QNetworkRequest a Q_GADGET. Task-number: QTBUG-114647 Change-Id: Idb4f3ecd98f79c1e28596c7be763898aba4b6562 Reviewed-by: Mårten Nordheim <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Juha Vuolle <[email protected]>
* Support for std::chrono as transferTimeout typeJuha Vuolle2023-12-081-11/+46
| | | | | | | | | | | | | | | | | | | | Provide users with means to use more modern time/duration type. Please note that since QTimer does not currently support timeouts larger than 'int' milliseconds, the limit on how long durations can be expressed, remains. This should not be an issue in practice with network requests, as a typical int32 system can express timeouts of ~24 days. [ChangeLog][QtNetwork][QNetworkAccessManager] Add std::chrono support for transfer timeout. [ChangeLog][QtNetwork][QNetworkRequest] Add std::chrono support for transfer timeout. Fixes: QTBUG-118714 Change-Id: If85678a5994c59bac5926e47f98c9cfeb2a07c30 Reviewed-by: Ivan Solovev <[email protected]>
* qnetworkrequest, qnetworkreply: port some methods to QBAVAnton Kudryavtsev2023-10-301-5/+5
| | | | | | | | | [ChangeLog][QtNetwork] Ported hasRawHeader and rawHeader of QNetworkReply and QNetworkRequest to QByteArrayView. Change-Id: Ife71ba11b1ee8907c104dba3210d7a033568edf4 Reviewed-by: Mårten Nordheim <[email protected]> Reviewed-by: Edward Welbourne <[email protected]>
* qhttpnetworkrequest: use range based for moreAnton Kudryavtsev2023-08-311-8/+4
| | | | | | | to improve readability Change-Id: Iaffb3ab8e4a188ee7cba3d9afc527cf3038a8040 Reviewed-by: Mårten Nordheim <[email protected]>
* qnetworkrequest: use _ba literal moreAnton Kudryavtsev2023-08-311-13/+13
| | | | | | | to avoid allocations Change-Id: I747d212e5752bcb42977d6714d241918363d47db Reviewed-by: Mårten Nordheim <[email protected]>
* qnetworkrequest: extract methodAnton Kudryavtsev2023-08-311-30/+20
| | | | | | | De-duplicate code for cookie header making Change-Id: I3ac59445089ee151a2f719454fa50cb9f37f72e4 Reviewed-by: Mårten Nordheim <[email protected]>
* qnetworkrequest: reduce branches in loopAnton Kudryavtsev2023-08-281-9/+9
| | | | | | | Unconditionally append separator and then chop last one Change-Id: I33d004df07ce0c3c0076dc374ae7a2f8c413aeba Reviewed-by: Mårten Nordheim <[email protected]>
* qnetworkrequest: port parseMatchImpl to QBAVAnton Kudryavtsev2023-08-281-10/+8
| | | | | | | to save allocations, and use tokenize to avoid temp container Change-Id: I2a43612b9d15538a93d4afd2c544714507141f0f Reviewed-by: Mårten Nordheim <[email protected]>
* qnetworkrequest: port parseHeaderName to QBAVAnton Kudryavtsev2023-08-281-3/+3
| | | | | Change-Id: I39af8649468636d09db46aac770f5df7a3582b50 Reviewed-by: Mårten Nordheim <[email protected]>
* qnetworkrequest: extract methodAnton Kudryavtsev2023-08-271-23/+13
| | | | | | | for If-Match and If-None-Match parsing Change-Id: I523f5c639a01bafe6f25f13c0d25b3c62fa75282 Reviewed-by: Mårten Nordheim <[email protected]>
* qnetworkrequest: use new parseCookies overloadAnton Kudryavtsev2023-08-271-3/+2
| | | | | | | While touching code, replace split with tokenize Change-Id: I3382ab6937892b0d6ba37591fbe3697a958c69bb Reviewed-by: Mårten Nordheim <[email protected]>
* QNetworkHeadersPrivate::findRawHeader: use algorithms moreAnton Kudryavtsev2023-08-261-7/+5
| | | | | | | No raw loops Change-Id: Ieeaff911f4c6f2c88d358fd1bc1250ffe75f5c6f Reviewed-by: Mårten Nordheim <[email protected]>
* qnetworkrequest: use QBAV moreAnton Kudryavtsev2023-08-251-3/+3
| | | | | | | to reduce allocations Change-Id: Ifcb7da9d302efafd7f890b6b3fb52b7a740274d1 Reviewed-by: Mårten Nordheim <[email protected]>
* QNetworkHeadersPrivate::findRawHeader: port to QBAVAnton Kudryavtsev2023-08-251-1/+1
| | | | | Change-Id: I15274eaa79d05a2aed909bada94276f98ae25fe8 Reviewed-by: Mårten Nordheim <[email protected]>
* Network: Remove unneeded Q_QDOC check for http featureKai Köhne2023-06-301-5/+5
| | | | | | | | | | http is enabled by default if you have threading support, which is true for qdoc. There is therefore no reason to believe that a normal qdoc configuration won't have it configured, and hence no need to check also explicitly for Q_QDOC. Pick-to: 6.6 Change-Id: I118388fedaa87225ce81a211d361d593da61105d Reviewed-by: Topi Reiniö <[email protected]>
* Doc: Remove duplicate wordsAndreas Eliasson2023-02-281-1/+1
| | | | | | Change-Id: Ia7a38a1035bd34d00f20351a0adc3927e473b2e7 Pick-to: 6.5 6.4 6.2 Reviewed-by: Topi Reiniö <[email protected]>
* Adapt to QTimeZone replacing Qt::TimeSpec usageEdward Welbourne2022-12-101-4/+6
| | | | | | | | | | | | In the process actually handle all time-spec cases in various places that only handled UTC or LocalTime, or at least note that they don't where that's not practical. Also tidy up header ordering and ensure QDateTime's header is included wherever it's used, while adding the include for QTimeZone where needed. Task-number: QTBUG-108199 Change-Id: Ic1a5cdf0aaf737bf1396aa8ac58ce2004cef7e19 Reviewed-by: Mårten Nordheim <[email protected]>
* QNetworkAccessManager: Configurable number of HTTP1 TCP connectionsMarkus Goetz2022-12-091-0/+28
| | | | | | | | | | | Introduces new class QHttp1Configuration. [ChangeLog][QtNetwork][QHttp1Configuration] New class. Fixes: QTBUG-25280 Fixes: QTBUG-108215 Change-Id: Ide6cee23946e5001befb8fab34edf10b8a66e02b Reviewed-by: Mårten Nordheim <[email protected]>
* QNetworkRequest: don't assume QByteArray::constData() is NUL-terminatedMarc Mutz2022-12-081-13/+17
| | | | | | | | | | | | | | | | | | | | | It isn't guaranteed to be, for QByteArrays originating from QByteArray::fromRawData(). Use the four-arg qstrnicmp() overload (with defaulted fourth argument), wrapped in a lambda to DRY, instead of qstricmp(), which may produce incorrect results or even read past user-supplied buffers. There were also uses of QByteArray::compare(c-literal, Qt::CaseInsensitive). They're not affected by the problem, but QByteArray is scheduled to lose its string-y API parts and become a container of octets in the future. Besides, the lambda solution is much nicer on the eye. Pick-to: 6.4 6.2 5.15 Change-Id: I1e0f9003082f4158edecc6fe8cf3c0518e5403f5 Reviewed-by: Thiago Macieira <[email protected]> Reviewed-by: Lorn Potter <[email protected]> Reviewed-by: Mårten Nordheim <[email protected]>
* QNetworkRequest: Make header parsing locale-independentMarc Mutz2022-12-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing header parsing used C's tolower() function for case-insensitive switching over the first character of the header. However, that function's result depends on the current locale. Since the parser is supposed to match the likes of "If-Match" and "If-None-Match", matching may fail in locales, such as Turkish, where tolower(I) is ı (LATIN SMALL LETTER DOTLESS I) (or I, if the former isn't representable in the current charset), causing a False Negative. To fix, use the US-ASCII-only QtMiscUtils::toAsciiLower() function, which has the added advantage that it's inline. Replace at(0) with front() as a drive-by. The WASM copy of the function is hopelessly outdated (recognizes less headers than the QNetworkRequest original). [ChangeLog][QtNetwork] Fixed a bug where certain QNetworkRequest::KnownHeaders wouldn't be recognized as such in certain locales. Pick-to: 6.4 6.2 5.15 Task-number: QTBUG-109235 Change-Id: Ib147ab64803bb868647dd07ad657d785071242ea Reviewed-by: Thiago Macieira <[email protected]> Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Mårten Nordheim <[email protected]>
* Replace usages of Q_CLANG_QDOC with Q_QDOCLuca Di Sera2022-10-211-5/+5
| | | | | | | | | | | | | | | | | | | | | | | To allow the user to customize the C++ code that QDoc sees, so as to be able to work-around some limitations on QDoc itself, QDoc defines two symbols: Q_QDOC and Q_CLANG_QDOC, both of which are "true" during an entire execution of QDoc. At a certain point in time, QDoc allowed the user the choice between a custom C++ parser and a Clang based one. The Q_QDOC symbol would always be defined while the Q_CLANG_QDOC symbol would be defined only when the Clang based parser was chosen. In more recent times, QDoc always uses a Clang based parser, such that both Q_CLANG_QDOC and Q_QDOC are always defined, making them equivalent. To avoid using different symbols, and the possible confusion and fragmentation that derives from it, all usages of Q_CLANG_QDOC are now replaced by the equivalent usages of Q_QDOC. Change-Id: I5810abb9ad1016a4c5bbea99acd03381b8514b3f Reviewed-by: Kai Koehne <[email protected]>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-111-2/+2
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace, with manual unstaging of the actual definition and documentation in dist/, src/corelib/doc/ and src/corelib/global/. Task-number: QTBUG-99313 Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541 Reviewed-by: Ivan Solovev <[email protected]>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* wasm: allow useCredentials access control to be setLorn Potter2022-09-281-0/+7
| | | | | | | | | | Introduce UseCredentialsAttribute that indicates whether the underlying fetch/XMLHttpRequest should use credentials https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials Fixes: QTBUG-90893 Change-Id: I2c43e286db52df387c0a22737d027b9a2a8dd2d3 Reviewed-by: Mårten Nordheim <[email protected]>
* QHttp2Configuration: in QNAM, use old, higher values in flow controlTimur Pocheptsov2022-08-301-5/+4
| | | | | | | | | | | | | | | | | | | | | Initially, stream receive window's size was quite significant. At some point when dealing with a server that did not want our windows' sizes and was closing the connection (they only accept 64K) we reduced this size, which ended in a regression with download speed significantly throttled. We return the old values (or even more, presuming we have 10 multiplexed streams and not 100). And also making QNAM consistent with its documentation (it was not updated). [ChangeLog][QtNetwork] Stream receive window that HTTP/2 protocol in QNAM is using increased to 214748364 octets (from the previous 64K) not to throttle download speed. Clients, working with servers, not accepting such parameters, must set HTTP/2 configuration on their requests accordingly. Fixes: QTBUG-105043 Pick-to: 6.4 6.3 6.2 Change-Id: I252b6b5eefe92a7304dad15c67928d5a57d9597f Reviewed-by: Mårten Nordheim <[email protected]>
* Remove mentions of SSL 3 in documentationMårten Nordheim2022-05-301-3/+2
| | | | | | | | | | And some s,SSL,TLS, in the same paragraphs. Changing SSL to TLS in the whole codebase looks odd given classes are still called QSsl*, but may be worth considering at some point. Pick-to: 6.3 6.2 Change-Id: I06dfcd99c1f6ac9e029e1914363344b3705d871f Reviewed-by: Timur Pocheptsov <[email protected]>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Jörg Bornemann <[email protected]>
* Fix documentation for QNetworkReply::redirectedFlorian Bruhin2022-05-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | In d12afeff4097dd78f1311511e0c8f74e1a810d47, the default redirect policy was changed to NoLessSafeRedirectPolicy (from ManualRedirectPolicy), and this was reworded from: This signal is emitted if the QNetworkRequest::FollowRedirectsAttribute was set in the request [...] (i.e.: Qt handles redirect, no manual handling) to: This signal is emitted if the QNetworkRequest::ManualRedirectPolicy was set in the request [...] (i.e.: User handles redirect, no handling by Qt), which is exactly the wrong way around. Only if Qt handles the redirect, it's able to send a signal about it. If the user handles redirects, they would get the RedirectionTargetAttribute in response to the finished() signal. Also see tst_QNetworkReply::ioHttpSingleRedirect(): It sets NoLessSafeRedirectPolicy (default since Qt 6) and then ensures the "redirected" signal has been emitted. Pick-to: 6.3 6.2 Change-Id: I7e80ff69b94a4d94eb541b1021b05601d183c733 Reviewed-by: Mårten Nordheim <[email protected]>
* QtNetwork: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-04-211-1/+3
| | | | | | Task-number: QTBUG-98434 Change-Id: Ic235b92377203f7a1429ae7fd784c4a1fa893e9f Reviewed-by: Mårten Nordheim <[email protected]>
* QtNetwork: sweep Q_DECLARE_METATYPE → QT_DECL_METATYPE_EXTERN [1/2]: ↵Marc Mutz2022-04-051-0/+3
| | | | | | | | | | | | | | public API It's one of our best tools to improve compile times. Can't backport to Qt 6.3 or 6.2 because this change introduces new exported symbols. Task-number: QTBUG-102206 Change-Id: I6bfa532be34ca847d3b9034d16c94efed3d602c3 Reviewed-by: Mårten Nordheim <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* QNetworkRequest: Document how Qt handles 301 and 302 status codesMårten Nordheim2022-01-181-0/+5
| | | | | | | | | To make it explicit Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-92909 Change-Id: I8f8dc99628168a566158acef72ae2a5e001eef88 Reviewed-by: Timur Pocheptsov <[email protected]>
* Convert date-time to UTC before claiming it's in GMTEdward Welbourne2022-01-171-4/+4
| | | | | | | | | | | | | | | | | | QNetworkHeadersPrivate::toHttpDate() used a custom format to output a date-time; the format supplied GMT as suffix, but neglected to convert the date-time to UTC, so local-time was formatted as if it were UTC, regardless of its actual offset from it. Fixing this (by the obvious toUTC() call) broke formatting when the supplied header value was a QDate, since it's packaged as a QVariant and QVariant's conversion of QDate to QDateTime uses local time's (not UTC's) start of day. So fix headerValue() to separate QDate and QDateTime cases and use startOfDay(Qt::UTC) to get the right start of the day. Added tests for non-UTC date-times appearing correctly in HTTP headers. Fixes: QTBUG-80666 Pick-to: 6.3 6.2 6.2.3 5.15 Change-Id: I2792bce14a07be025cf551b0594630260c112269 Reviewed-by: Mårten Nordheim <[email protected]>
* QNAM: Reintroduce h2c with an attributeMårten Nordheim2021-12-041-3/+14
| | | | | | | | | | | [ChangeLog][QtNetwork][QNetworkRequest] Added QNetworkRequest::Http2CleartextAllowedAttribute which controls whether HTTP/2 cleartext (h2c) is allowed or not. The default is false. This replaces the QT_NETWORK_H2C_ALLOWED environment variable. Task-number: QTBUG-98642 Change-Id: I43ae1cc671788f6d2559cd316f6667b412c8e75e Reviewed-by: Edward Welbourne <[email protected]>
* Don't send the default SETTINGS_INITIAL_WINDOW_SIZETimur Pocheptsov2021-10-121-6/+7
| | | | | | | | | | And don't set non-default large value in QNetworkRequest's constructor. Some servers consider those values as 'flow control error'. Pick-to: 6.2 Fixes: QTBUG-97384 Change-Id: I801b7c83fe7e7392a02ba653c36dfa8a22c21d1e Reviewed-by: Mårten Nordheim <[email protected]>
* QNAM: Allow to configure when connections to a host are torn downMarkus Goetz2021-07-271-0/+6
| | | | | | | | | | | | This introduces a new attribute that allows behavior to keep the TCP connection(s) to a HTTP1/HTTP2 host longer or shorter than the default of 120 seconds. Note that the server might still close the connection earlier. Fixes: QTBUG-20726 Fixes: QTBUG-91440 Change-Id: I7da64230a78c642c12c0ddbe6b678cf17c3aafde Reviewed-by: Mårten Nordheim <[email protected]>
* QNetworkRequest: Fix decompression safety-check threshold docsMårten Nordheim2021-07-131-2/+2
| | | | | | | | | | The \sa was neglected Amends d33040548ff727a040ea66174cbd838e883fed56 Pick-to: 6.2 Change-Id: Ib298ac3390819f9ea4092a1f2bf470ea82c9e4fe Reviewed-by: Andreas Buhr <[email protected]>
* QNetworkRequest: Rename (set)minimumArchiveBombSizeMårten Nordheim2021-07-021-7/+7
| | | | | | | | | To (set)decompressedSafetyCheckThreshold, as suggested on the API review. Task-number: QTBUG-94407 Change-Id: Iffc52691022939ae46703de8a0416355487b716f Reviewed-by: Timur Pocheptsov <[email protected]> Reviewed-by: Edward Welbourne <[email protected]>
* QNetworkRequest: Add API to set a minimum archive bomb sizeMårten Nordheim2021-05-311-0/+46
| | | | | | Fixes: QTBUG-91870 Change-Id: Ia23e8b8bcfdf65a91fe57e739242a355c681c9e6 Reviewed-by: Edward Welbourne <[email protected]>