Changeset View
Changeset View
Standalone View
Standalone View
src/ioslaves/http/http.cpp
Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Line(s) | 165 | { | |||
---|---|---|---|---|---|
167 | const QStringList headers = _header.split(QRegExp(QStringLiteral("[\r\n]"))); | 167 | const QStringList headers = _header.split(QRegExp(QStringLiteral("[\r\n]"))); | ||
168 | 168 | | |||
169 | for (const QString &header : headers) { | 169 | for (const QString &header : headers) { | ||
170 | // Do not allow Request line to be specified and ignore | 170 | // Do not allow Request line to be specified and ignore | ||
171 | // the other HTTP headers. | 171 | // the other HTTP headers. | ||
172 | if (!header.contains(QLatin1Char(':')) || | 172 | if (!header.contains(QLatin1Char(':')) || | ||
173 | header.startsWith(QLatin1String("host"), Qt::CaseInsensitive) || | 173 | header.startsWith(QLatin1String("host"), Qt::CaseInsensitive) || | ||
174 | header.startsWith(QLatin1String("proxy-authorization"), Qt::CaseInsensitive) || | 174 | header.startsWith(QLatin1String("proxy-authorization"), Qt::CaseInsensitive) || | ||
175 | header.startsWith(QLatin1String("via"), Qt::CaseInsensitive)) { | 175 | header.startsWith(QLatin1String("via"), Qt::CaseInsensitive) || | ||
176 | header.startsWith(QLatin1String("depth"), Qt::CaseInsensitive)) { | ||||
176 | continue; | 177 | continue; | ||
177 | } | 178 | } | ||
178 | 179 | | |||
179 | sanitizedHeaders += header + QLatin1String("\r\n"); | 180 | sanitizedHeaders += header + QLatin1String("\r\n"); | ||
180 | } | 181 | } | ||
181 | sanitizedHeaders.chop(2); | 182 | sanitizedHeaders.chop(2); | ||
182 | 183 | | |||
183 | return sanitizedHeaders; | 184 | return sanitizedHeaders; | ||
▲ Show 20 Lines • Show All 2410 Lines • ▼ Show 20 Line(s) | 2380 | { | |||
2594 | 2595 | | |||
2595 | if (hasDavData || m_protocol == "webdav" || m_protocol == "webdavs") { | 2596 | if (hasDavData || m_protocol == "webdav" || m_protocol == "webdavs") { | ||
2596 | header += davProcessLocks(); | 2597 | header += davProcessLocks(); | ||
2597 | 2598 | | |||
2598 | // add extra webdav headers, if supplied | 2599 | // add extra webdav headers, if supplied | ||
2599 | davHeader += metaData(QStringLiteral("davHeader")); | 2600 | davHeader += metaData(QStringLiteral("davHeader")); | ||
2600 | 2601 | | |||
2601 | // Set content type of webdav data | 2602 | // Set content type of webdav data | ||
2602 | if (hasDavData) { | 2603 | if (hasDavData && !header.contains(QLatin1String("Content-Type: "))) { | ||
2603 | davHeader += QStringLiteral("Content-Type: text/xml; charset=utf-8\r\n"); | 2604 | davHeader += QStringLiteral("Content-Type: text/xml; charset=utf-8\r\n"); | ||
2604 | } | 2605 | } | ||
2605 | 2606 | | |||
2606 | // add extra header elements for WebDAV | 2607 | // add extra header elements for WebDAV | ||
2607 | header += davHeader; | 2608 | header += davHeader; | ||
2608 | } | 2609 | } | ||
2609 | } | 2610 | } | ||
2610 | 2611 | | |||
▲ Show 20 Lines • Show All 3017 Lines • Show Last 20 Lines |