Changeset 69946 in webkit
- Timestamp:
- Oct 18, 2010, 1:15:25 AM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r69938 r69946 1 2010-10-17 Andreas Kling <kling@webkit.org> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Support custom open() verbs/methods in XMLHttpRequest 6 https://bugs.webkit.org/show_bug.cgi?id=40476 7 8 Fall back to QNetworkAccessManager::CustomOperation for any HTTP verb 9 that's not specifically supported by QNetworkAccessManager. 10 11 This prevents the infinite loop that otherwise occurs after sending 12 an UnknownOperation request. 13 14 This change is covered by existing (skipped) tests that will be 15 unskipped once the Qt bots are running Qt 4.7. 16 17 * platform/network/qt/QNetworkReplyHandler.cpp: 18 (WebCore::QNetworkReplyHandler::httpMethod): 19 (WebCore::QNetworkReplyHandler::QNetworkReplyHandler): 20 (WebCore::QNetworkReplyHandler::sendResponseIfNeeded): 21 * platform/network/qt/QNetworkReplyHandler.h: 22 1 23 2010-10-17 Adam Barth <abarth@webkit.org> 2 24 -
trunk/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
r69064 r69946 156 156 } 157 157 158 static QString httpMethodString(QNetworkAccessManager::Operation method) 159 { 160 switch (m ethod) {158 String QNetworkReplyHandler::httpMethod() const 159 { 160 switch (m_method) { 161 161 case QNetworkAccessManager::GetOperation: 162 162 return "GET"; … … 167 167 case QNetworkAccessManager::PutOperation: 168 168 return "PUT"; 169 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)170 169 case QNetworkAccessManager::DeleteOperation: 171 170 return "DELETE"; 172 #endif173 171 #if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0) 174 172 case QNetworkAccessManager::CustomOperation: 175 return "OPTIONS";173 return m_resourceHandle->firstRequest().httpMethod(); 176 174 #endif 177 175 default: 176 ASSERT_NOT_REACHED(); 178 177 return "GET"; 179 178 } … … 207 206 m_method = QNetworkAccessManager::DeleteOperation; 208 207 #if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0) 209 else if (r.httpMethod() == "OPTIONS")208 else 210 209 m_method = QNetworkAccessManager::CustomOperation; 211 #e ndif210 #else 212 211 else 213 212 m_method = QNetworkAccessManager::UnknownOperation; 213 #endif 214 214 215 215 QObject* originatingObject = 0; … … 411 411 412 412 ResourceRequest newRequest = m_resourceHandle->firstRequest(); 413 newRequest.setHTTPMethod(httpMethod String(m_method));413 newRequest.setHTTPMethod(httpMethod()); 414 414 newRequest.setURL(newUrl); 415 415 -
trunk/WebCore/platform/network/qt/QNetworkReplyHandler.h
r69064 r69946 68 68 void start(); 69 69 void resetState(); 70 String httpMethod() const; 70 71 71 72 QNetworkReply* m_reply;
Note:
See TracChangeset
for help on using the changeset viewer.