ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/Smersh/Redirector.cpp
(Generate patch)

Comparing Smersh/Redirector.cpp (file contents):
Revision 181 by Douglas Thrift, 2004-07-03T05:41:00-07:00 vs.
Revision 182 by Douglas Thrift, 2004-07-03T06:52:04-07:00

# Line 23 | Line 23 | int Redirector::handle(Client* client)
23          bool head(env.get("REQUEST_METHOD") == "HEAD");
24          streamsize sent(0);
25  
26 <        if (code == found)
26 >        if (code == found || code == seeOther)
27          {
28                  string location(redirect + '?' + query(post, env));
29  
# Line 63 | Line 63 | int Redirector::handle(Client* client)
63          delete client;
64   }
65  
66 < string Redirector::query(istream& sin, const Environment& env)
66 > string Redirector::query(const stringstream& post, const Environment& env)
67   {
68 <        ostringstream query;
69 <        
70 <        return query.str();
68 >        string query(env.get("REQUEST_METHOD") != "POST" ? env.get("QUERY_STRING") :
69 >                post.str());
70 >
71 >        for (string::size_type index(0); index < query.length(); ++index)
72 >        {
73 >                if (isspace(query[index])) query.replace(index, 1, 1, '+');
74 >        }
75 >
76 >        if (debug) cerr << "query = " << query << '\n';
77 >
78 >        return query;
79   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines