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 |
|
|
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 |
|
} |