diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/LuaHttp.cc | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/lib/LuaHttp.cc b/lib/LuaHttp.cc index cfa26da..be4f143 100644 --- a/lib/LuaHttp.cc +++ b/lib/LuaHttp.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: LuaHttp.cc,v 1.29 2008-07-18 14:02:39 pixel Exp $ */ +/* $Id: LuaHttp.cc,v 1.30 2008-07-27 10:47:46 pixel Exp $ */ #include "Domain.h" #include "LuaHttp.h" @@ -405,13 +405,18 @@ void LuaDomain::Do(const HttpRequest & req, HttpResponse * res) throw (GeneralEx char * v = (*(req.vars))[i].strdup(), * p; p = strchr(v, '='); - *p = 0; - p++; - - L->push(v); - L->push(p); - L->settable(); + if (!p) { + L->push(v); + L->push(true); + } else { + *p = 0; + p++; + L->push(v); + L->push(p); + } + + L->settable(); free(v); } L->settable(); @@ -422,6 +427,10 @@ void LuaDomain::Do(const HttpRequest & req, HttpResponse * res) throw (GeneralEx char * v = (*(req.headers))[i].strdup(), * p; p = strchr(v, '='); + if (!p) { + free(v); + continue; + } *p = 0; p++; |