[mapguide-commits] r7257 - in trunk/MgDev/Web/src: CgiAgent IsapiAgent
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Dec 11 17:16:43 PST 2012
Author: jng
Date: 2012-12-11 17:16:42 -0800 (Tue, 11 Dec 2012)
New Revision: 7257
Modified:
trunk/MgDev/Web/src/CgiAgent/CgiPostParser.cpp
trunk/MgDev/Web/src/IsapiAgent/IsapiPostParser.cpp
Log:
#2199: Trunk merge of r7256
Modified: trunk/MgDev/Web/src/CgiAgent/CgiPostParser.cpp
===================================================================
--- trunk/MgDev/Web/src/CgiAgent/CgiPostParser.cpp 2012-12-12 01:12:37 UTC (rev 7256)
+++ trunk/MgDev/Web/src/CgiAgent/CgiPostParser.cpp 2012-12-12 01:16:42 UTC (rev 7257)
@@ -122,26 +122,33 @@
string content = contentType;
DumpMessage("Content type: %s", content.c_str());
+ if (content.empty())
+ {
+ params->SetXmlPostData("");
+ }
if (content.find(MapAgentStrings::UrlEncoded) == 0)
{
- m_buf[nBytes] = '\0';
+ if (nBytes > 0)
+ {
+ m_buf[nBytes] = '\0';
- // Here's another case of interoperability "Forgiveness
- // and Tolerance": degree, among other clients, sends along
- // a POST with xml contents, but fails to correctly set the
- // mime type. You guessed it: it says it's url-encoded.
- // ----------------
- // If we got here, but determine that the contents look
- // and feel like XML, it's a safe bet that it should
- // be treated like XML. Otherwise, we assume the
- // content-type is probably correct. (Note that
- // the IsXmlPi should conveniently fail if it really IS
- // url-encoded, since the question mark in <?xml...?>
- // should itself be url-encoded: <%3Fxml... )
- if(IsXmlPi(m_buf))
- params->SetXmlPostData(m_buf);
- else
- MapAgentGetParser::Parse(m_buf, params);
+ // Here's another case of interoperability "Forgiveness
+ // and Tolerance": degree, among other clients, sends along
+ // a POST with xml contents, but fails to correctly set the
+ // mime type. You guessed it: it says it's url-encoded.
+ // ----------------
+ // If we got here, but determine that the contents look
+ // and feel like XML, it's a safe bet that it should
+ // be treated like XML. Otherwise, we assume the
+ // content-type is probably correct. (Note that
+ // the IsXmlPi should conveniently fail if it really IS
+ // url-encoded, since the question mark in <?xml...?>
+ // should itself be url-encoded: <%3Fxml... )
+ if(IsXmlPi(m_buf))
+ params->SetXmlPostData(m_buf);
+ else
+ MapAgentGetParser::Parse(m_buf, params);
+ }
}
else if (content.find(MapAgentStrings::MultiPartForm) != content.npos)
{
Modified: trunk/MgDev/Web/src/IsapiAgent/IsapiPostParser.cpp
===================================================================
--- trunk/MgDev/Web/src/IsapiAgent/IsapiPostParser.cpp 2012-12-12 01:12:37 UTC (rev 7256)
+++ trunk/MgDev/Web/src/IsapiAgent/IsapiPostParser.cpp 2012-12-12 01:16:42 UTC (rev 7257)
@@ -117,26 +117,33 @@
string content = m_pECB->lpszContentType;
+ if (content.empty())
+ {
+ params->SetXmlPostData("");
+ }
if (content.find(MapAgentStrings::UrlEncoded) == 0)
{
- m_pBuffer[dwTotalBytes] = '\0'; // null terminate
+ if (dwTotalBytes > 0)
+ {
+ m_pBuffer[dwTotalBytes] = '\0'; // null terminate
- // Here's another case of interoperability "Forgiveness
- // and Tolerance": degree, among other clients, sends along
- // a POST with xml contents, but fails to correctly set the
- // mime type. You guessed it: it says it's url-encoded.
- // ----------------
- // If we got here, but determine that the contents look
- // and feel like XML, it's a safe bet that it should
- // be treated like XML. Otherwise, we assume the
- // content-type is probably correct. (Note that
- // the IsXmlPi should conveniently fail if it really IS
- // url-encoded, since the question mark in <?xml...?>
- // should itself be url-encoded: <%3Fxml... )
- if (MapAgentCommon::IsXmlPi((char *)m_pBuffer))
- params->SetXmlPostData((char *)m_pBuffer);
- else
- MapAgentGetParser::Parse((char *)m_pBuffer, params);
+ // Here's another case of interoperability "Forgiveness
+ // and Tolerance": degree, among other clients, sends along
+ // a POST with xml contents, but fails to correctly set the
+ // mime type. You guessed it: it says it's url-encoded.
+ // ----------------
+ // If we got here, but determine that the contents look
+ // and feel like XML, it's a safe bet that it should
+ // be treated like XML. Otherwise, we assume the
+ // content-type is probably correct. (Note that
+ // the IsXmlPi should conveniently fail if it really IS
+ // url-encoded, since the question mark in <?xml...?>
+ // should itself be url-encoded: <%3Fxml... )
+ if (MapAgentCommon::IsXmlPi((char *)m_pBuffer))
+ params->SetXmlPostData((char *)m_pBuffer);
+ else
+ MapAgentGetParser::Parse((char *)m_pBuffer, params);
+ }
}
else if (content.find(MapAgentStrings::MultiPartForm) != content.npos)
{
More information about the mapguide-commits
mailing list