Update QtWebApp to 1.8.3

nullptr redefinition for old __cplusplus versions has been removed, the rest is vanilla
This commit is contained in:
Luis Ángel San Martín
2021-10-03 21:17:49 +02:00
parent baccb1a21b
commit 986450eb20
20 changed files with 131 additions and 43 deletions

View File

@ -14,7 +14,9 @@ HttpCookie::HttpCookie()
secure=false;
}
HttpCookie::HttpCookie(const QByteArray name, const QByteArray value, const int maxAge, const QByteArray path, const QByteArray comment, const QByteArray domain, const bool secure, const bool httpOnly)
HttpCookie::HttpCookie(const QByteArray name, const QByteArray value, const int maxAge, const QByteArray path,
const QByteArray comment, const QByteArray domain, const bool secure, const bool httpOnly,
const QByteArray sameSite)
{
this->name=name;
this->value=value;
@ -24,6 +26,7 @@ HttpCookie::HttpCookie(const QByteArray name, const QByteArray value, const int
this->domain=domain;
this->secure=secure;
this->httpOnly=httpOnly;
this->sameSite=sameSite;
this->version=1;
}
@ -32,6 +35,7 @@ HttpCookie::HttpCookie(const QByteArray source)
version=1;
maxAge=0;
secure=false;
httpOnly=false;
QList<QByteArray> list=splitCSV(source);
foreach(QByteArray part, list)
{
@ -76,6 +80,10 @@ HttpCookie::HttpCookie(const QByteArray source)
{
httpOnly=true;
}
else if (name=="SameSite")
{
sameSite=value;
}
else if (name=="Version")
{
version=value.toInt();
@ -125,6 +133,10 @@ QByteArray HttpCookie::toByteArray() const
if (httpOnly) {
buffer.append("; HttpOnly");
}
if (!sameSite.isEmpty()) {
buffer.append("; SameSite=");
buffer.append(sameSite);
}
buffer.append("; Version=");
buffer.append(QByteArray::number(version));
return buffer;
@ -170,6 +182,11 @@ void HttpCookie::setHttpOnly(const bool httpOnly)
this->httpOnly=httpOnly;
}
void HttpCookie::setSameSite(const QByteArray sameSite)
{
this->sameSite=sameSite;
}
QByteArray HttpCookie::getName() const
{
return name;
@ -210,6 +227,11 @@ bool HttpCookie::getHttpOnly() const
return httpOnly;
}
QByteArray HttpCookie::getSameSite() const
{
return sameSite;
}
int HttpCookie::getVersion() const
{
return version;