+
+ while (*slash) {
+ if (*slash == '?') {
+ m_uri += slash;
+ break;
+ }
+ else if (*slash == ';') {
+ // If this is Java being stupid, skip everything up to the query string, if any.
+ if (!strncmp(slash, ";jsessionid=", 12)) {
+ if (slash = strchr(slash, '?'))
+ m_uri += slash;
+ break;
+ }
+ else {
+ m_uri += *slash;
+ }
+ }
+ else if (*slash != '%') {
+ m_uri += *slash;
+ }
+ else {
+ ++slash;
+ if (!isxdigit(*slash) || !isxdigit(*(slash+1)))
+ throw invalid_argument("Bad request, contained unsupported encoded characters.");
+ m_uri += _x2c(slash);
+ ++slash;
+ }
+ ++slash;
+ }