Fix GWT plugin: Correctly parse "gwt.codesvr" when URL encoded. (ex: "?gwt.codesvr=127.0.0.1%3A9997"). This is necessary for firefox 3.6+ to be able to run GWT tests. Review by: skybrian@google.com git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@11256 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/plugins/common/AllowedConnections.cpp b/plugins/common/AllowedConnections.cpp index c04698b..ffe6441 100644 --- a/plugins/common/AllowedConnections.cpp +++ b/plugins/common/AllowedConnections.cpp
@@ -80,8 +80,15 @@ paramStart += 12; int colon = url.find(':', paramStart); - int variableEnd = url.find('&', paramStart); + // After navigation, the URL parameter could be encoded. + // ex: gwt.codesvr=127.0.0.1:9997 -> gwt.codesvr=127.0.0.1%3A9997. + int colonEncoded = url.find("%3A", paramStart); + if (colonEncoded != std::string::npos + && (colon == std::string::npos || colonEncoded < colon)) { + colon = colonEncoded; + } + int variableEnd = url.find('&', paramStart); if ( variableEnd == std::string::npos || colon < variableEnd) { variableEnd = colon; //could be std::string::npos! }