HttpQuery: CaseSensitive

git-svn-id: svn://ultimatepp.org/upp/trunk@4580 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2012-02-12 21:53:20 +00:00
parent 0d8fc6df3b
commit 1736bf4e0a
4 changed files with 10 additions and 19 deletions

View file

@ -444,22 +444,6 @@ String Format(Time time, bool seconds)
: Format(" %02d:%02d", time.hour, time.minute));
}
Time ScanTime(const char *fmt, const char *s, Date def)
{
Date d;
if(StrToDate(fmt, d, s, def))
return d;
return def;
}
Time ScanTime(const char *s, Date def)
{
Date d;
if(StrToDate(d, s, def))
return d;
return def;
}
const char *StrToTime(Time& d, const char *s)
{
s = StrToDate(d, s);

View file

@ -18,6 +18,9 @@ ScgiServer::ScgiServer(int port)
signal(SIGABRT, sighandler);
signal(SIGINT, sighandler);
signal(SIGTERM, sighandler);
query.CaseSensitive();
post.CaseSensitive();
}
void ScgiServer::Process()

View file

@ -579,7 +579,7 @@ HttpQuery& HttpQuery::SetURL(const String& url)
const char *last = p;
while(*p && *p != '=' && *p != '&')
p++;
String key = ToUpper(UrlDecode(last, p));
String key = case_sensitive ? UrlDecode(last, p) : ToUpper(UrlDecode(last, p));
if(*p == '=')
p++;
last = p;

View file

@ -216,10 +216,14 @@ private:
VectorMap<String, String> map;
};
bool case_sensitive;
public:
HttpQuery(const Nuller& = Null) : data(Empty()) {}
explicit HttpQuery(String url) { data = Empty(); SetURL(url); }
HttpQuery(const Nuller& = Null) : data(Empty()) { case_sensitive = false; }
explicit HttpQuery(String url) { data = Empty(); SetURL(url); case_sensitive = false; }
void CaseSensitive(bool b = true) { case_sensitive = b; }
void Serialize(Stream& stream);