6#include <private/qoffsetstringarray_p.h>
8#include <QtCore/qcompare.h>
9#include <QtCore/qhash.h>
10#include <QtCore/qloggingcategory.h>
11#include <QtCore/qmap.h>
12#include <QtCore/qset.h>
13#include <QtCore/qttypetraits.h>
103 "access-control-allow-credentials",
104 "access-control-allow-headers",
105 "access-control-allow-methods",
106 "access-control-allow-origin",
107 "access-control-expose-headers",
108 "access-control-max-age",
109 "access-control-request-headers",
110 "access-control-request-method",
117 "apply-to-redirect-ref",
118 "authentication-control",
119 "authentication-info",
136 "content-disposition",
143 "content-security-policy",
144 "content-security-policy-report-only",
147 "cross-origin-embedder-policy",
148 "cross-origin-embedder-policy-report-only",
149 "cross-origin-opener-policy",
150 "cross-origin-opener-policy-report-only",
151 "cross-origin-resource-policy",
175 "if-schedule-tag-match",
176 "if-unmodified-since",
178 "include-referred-token-binding-id",
196 "optional-www-authenticate",
199 "origin-agent-cluster",
207 "preference-applied",
209 "proxy-authenticate",
210 "proxy-authentication-info",
211 "proxy-authorization",
214 "public-key-pins-report-only",
226 "sec-websocket-accept",
227 "sec-websocket-extensions",
229 "sec-websocket-protocol",
230 "sec-websocket-version",
239 "strict-transport-security",
241 "surrogate-capability",
258 "want-content-digest",
261 "x-content-type-options",
273struct ByIndirectHeaderName
275 constexpr bool operator()(
quint8 lhs,
quint8 rhs)
const noexcept
277 return (*
this)(
map(lhs),
map(rhs));
281 return (*
this)(
map(lhs), rhs);
285 return (*
this)(lhs,
map(rhs));
290 return std::string_view(lhs) < std::string_view(rhs);
488 ByIndirectHeaderName{}));
707 data = std::move(nname);
717 auto result = std::lower_bound(indexesBegin, indexesEnd,
name, ByIndirectHeaderName{});
727 using T =
decltype(
arg);
728 if constexpr (std::is_same_v<T, const QByteArray &>)
730 else if constexpr (std::is_same_v<T, const QHttpHeaders::WellKnownHeader &>)
740 using T =
decltype(
arg);
741 if constexpr (std::is_same_v<T, const QByteArray &>) {
743 }
else if constexpr (std::is_same_v<T, const QHttpHeaders::WellKnownHeader &>) {
754 std::variant<QHttpHeaders::WellKnownHeader, QByteArray>
data;
763 return lhs.data == rhs.data;
790 using Self = QExplicitlySharedDataPointer<QHttpHeadersPrivate>;
807 }
else if (
d->ref.loadRelaxed() != 1) {
818 const auto matchOffset =
it -
d->headers.
cbegin();
821 d->headers.erase(std::remove_if(
d->headers.begin() + matchOffset,
d->headers.end(),
829 const char* separator =
"";
830 for (
const auto &
h : std::as_const(headers)) {
831 if (
h.name ==
name) {
841 for (
const auto &
h : std::as_const(headers)) {
849 for (
const auto &
h : std::as_const(headers)) {
860 if (
it !=
d->headers.
end()) {
890 for (
const auto &
header : headers)
905 for (
const auto &[
name,
value] : headers.asKeyValueRange())
920 for (
const auto &[
name,
value] : headers.asKeyValueRange())
965#ifndef QT_NO_DEBUG_STREAM
975 debug.resetFormat().nospace();
977 debug <<
"QHttpHeaders(";
979 debug <<
"headers = ";
980 const char *separator =
"";
981 for (
const auto &
h : headers.d->
headers) {
982 debug << separator <<
h.name.asView() <<
':' <<
h.value;
1005 bool inMultibyte =
false;
1006 for (
unsigned char c :
s) {
1012 if ((
c & 0b1110'0000) == 0b1100'0000) {
1016 const auto bits_7_to_11 =
c & 0b0001'1111;
1017 if (bits_7_to_11 < 0b10)
1019 if (bits_7_to_11 > 0b11)
1021 }
else if ((
c & 0b1100'0000) == 0b1000'0000) {
1024 inMultibyte =
false;
1045 return ((
'A' <=
c &&
c <=
'Z')
1046 || (
'a' <=
c &&
c <=
'z')
1047 || (
'0' <=
c &&
c <=
'9')
1048 || (
'#' <=
c &&
c <=
'\'')
1049 || (
'^' <=
c &&
c <=
'`')
1050 ||
c ==
'|' ||
c ==
'~' ||
c ==
'!' ||
c ==
'*' ||
c ==
'+' ||
c ==
'-' ||
c ==
'.');
1069 return isValidHttpHeaderNameChar(c.toLatin1());
1075 if (
name.isEmpty()) {
1076 qCWarning(lcQHttpHeaders,
"HTTP header name cannot be empty");
1081 qCWarning(lcQHttpHeaders,
"HTTP header name contained illegal character(s)");
1098 || (0x20 <=
c &&
c <= 0x7E)
1117 return isValidHttpHeaderValueChar(c.toLatin1());
1125 qCWarning(lcQHttpHeaders,
"HTTP header value contained illegal character(s)");
1337 d->headers.removeAt(
i);
1349 return defaultValue;
1360 return defaultValue;
1373 QList<QByteArray>
result;
1386 QList<QByteArray>
result;
1403 return d->headers.at(
i).value;
1462 return d->headers.size();
1475 d->headers.reserve(
size);
1500 QList<std::pair<QByteArray, QByteArray>>
list;
1504 for (
const auto &
h : std::as_const(
d->headers))
1515 QMultiMap<QByteArray, QByteArray>
map;
1518 for (
const auto &
h : std::as_const(
d->headers))
1529 QMultiHash<QByteArray, QByteArray>
hash;
1533 for (
const auto &
h : std::as_const(
d->headers))
1534 hash.insert(
h.name.asByteArray(),
h.value);
static QByteArray fromRawData(const char *data, qsizetype size)
Constructs a QByteArray that uses the first size bytes of the data array.
void detach()
If the shared data object's reference count is greater than 1, this function creates a deep copy of t...
constexpr QLatin1Char at(qsizetype i) const
void reserve(qsizetype size)
void append(parameter_type t)
iterator insert(const Key &key, const T &value)
const_iterator cend() const noexcept
const_iterator cbegin() const noexcept
QHash< int, QWidget * > hash
[35multi]
QMap< QString, QString > map
[6]
list append(new Employee("Blackpool", "Stephen"))
QSet< QString >::iterator it
Combined button and popup list for selecting options.
constexpr bool is_sorted(ForwardIterator first, ForwardIterator last, BinaryPredicate p={})
#define Q_DECLARE_EQUALITY_COMPARABLE(...)
static QString header(const QString &name)
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_LOGGING_CATEGORY(name,...)
#define qCWarning(category,...)
constexpr auto qOffsetStringArray(const char(&...strings)[Nx]) noexcept
GLenum GLsizei GLsizei GLint * values
[15]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLfloat GLfloat GLfloat GLfloat h
#define QT_DEFINE_QESDP_SPECIALIZATION_DTOR(Class)
QT_BEGIN_NAMESPACE constexpr std::underlying_type_t< Enum > qToUnderlying(Enum e) noexcept