Relax content type check.
authorScott Cantor <cantor.2@osu.edu>
Mon, 22 Jan 2007 17:00:51 +0000 (17:00 +0000)
committerScott Cantor <cantor.2@osu.edu>
Mon, 22 Jan 2007 17:00:51 +0000 (17:00 +0000)
xmltooling/soap/impl/SOAPClient.cpp

index d785b63..ec0d781 100644 (file)
@@ -74,6 +74,11 @@ Envelope* SOAPClient::receive()
     if (!out)
         return NULL;    // nothing yet
     
+    // Check content type.
+    string s = m_transport->getContentType();
+    if (s.find("text/xml") == string::npos)
+        throw IOException("Incorrect content type ($1) for SOAP response.", params(1,s.c_str() ? s.c_str() : "none"));
+    
     // Parse and bind the document into an XMLObject.
     DOMDocument* doc = (m_validate ? XMLToolingConfig::getConfig().getValidatingParser()
         : XMLToolingConfig::getConfig().getParser()).parse(out);