| 103 | } |
| 104 | |
| 105 | QByteArray HttpCookie::toByteArray() const |
| 106 | { |
| 107 | QByteArray buffer(name); |
| 108 | buffer.append('='); |
| 109 | buffer.append(value); |
| 110 | if (!comment.isEmpty()) |
| 111 | { |
| 112 | buffer.append("; Comment="); |
| 113 | buffer.append(comment); |
| 114 | } |
| 115 | if (!domain.isEmpty()) |
| 116 | { |
| 117 | buffer.append("; Domain="); |
| 118 | buffer.append(domain); |
| 119 | } |
| 120 | if (maxAge!=0) |
| 121 | { |
| 122 | buffer.append("; Max-Age="); |
| 123 | buffer.append(QByteArray::number(maxAge)); |
| 124 | } |
| 125 | if (!path.isEmpty()) |
| 126 | { |
| 127 | buffer.append("; Path="); |
| 128 | buffer.append(path); |
| 129 | } |
| 130 | if (secure) { |
| 131 | buffer.append("; Secure"); |
| 132 | } |
| 133 | if (httpOnly) { |
| 134 | buffer.append("; HttpOnly"); |
| 135 | } |
| 136 | if (!sameSite.isEmpty()) { |
| 137 | buffer.append("; SameSite="); |
| 138 | buffer.append(sameSite); |
| 139 | } |
| 140 | buffer.append("; Version="); |
| 141 | buffer.append(QByteArray::number(version)); |
| 142 | return buffer; |
| 143 | } |
| 144 | |
| 145 | void HttpCookie::setName(const QByteArray name) |
| 146 | { |
no test coverage detected