MapGuide Open Source:  Home |  Download |  Internals

Changeset 3219

Show
Ignore:
Timestamp:
06/20/08 17:28:55 (5 months ago)
Author:
tomfukushima
Message:

#378 AJAX viewer does not load map in Firefox 3

For posts, FF3 sends "application/x-www-form-urlencoded; charset=UTF-8" as the content type. FF2 and other browsers send "application/x-www-form-urlencoded". The code does an exact string match on the latter string and so fails for FF3. This subsequently causes an unhandled exception that will cause Apache to crash.

The fix is to stop doing the extract string match and now just search for the "application/x-www-form-urlencoded" at the start of the ContentType? string. The fix needs to be applied in 3 places, the apache module, the plain cgi agent and the ISAPI agent.

Very easy fix to find, pretty much anyone with a debugger could probably have figured this out. It was just a matter of breaking at the exception and then following the stack to the method that had the bad code.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/MgDev/Web/src/ApacheAgent/ApachePostParser.cpp

    r2913 r3219  
    9191    } 
    9292 
    93     if (content == MapAgentStrings::UrlEncoded && totalBytes > 0) 
     93    if (content.find(MapAgentStrings::UrlEncoded) == 0 && totalBytes > 0) 
    9494    { 
    9595        m_pBuffer[totalBytes] = '\0'; 
     
    168168 
    169169 
     170 
  • trunk/MgDev/Web/src/CgiAgent/CgiPostParser.cpp

    r2913 r3219  
    123123        DumpMessage("Content type: %s", content.c_str()); 
    124124 
    125         if (content == MapAgentStrings::UrlEncoded
     125        if (content.find(MapAgentStrings::UrlEncoded) == 0
    126126        { 
    127127            m_buf[nBytes] = '\0'; 
  • trunk/MgDev/Web/src/IsapiAgent/IsapiPostParser.cpp

    r2913 r3219  
    118118    string content = m_pECB->lpszContentType; 
    119119 
    120     if (content == MapAgentStrings::UrlEncoded
     120    if (content.find(MapAgentStrings::UrlEncoded) == 0
    121121    { 
    122122        m_pBuffer[dwTotalBytes] = '\0';  // null terminate 
     
    195195 
    196196 
     197