[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[PATCH] Add date header parsing, error handling for HttpServletImpl.cpp. Code sync.
From: Sergey Jukov <sergey@total-knowledge.com>
---
ChangeLog | 7 +++++++
src/container/HttpServletRequestImpl.cpp | 6 +++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fb2b0a8..7f1a158 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006.13.08 Sergey Jukov <sergey@total-knowledge>
+- Fix date header parsing issue in HttpServletImpl.cpp, add exception for
+date header parsing. Code sync.
+
+2006.09.08 Sergey Jukov <sergey@total-knowledge>
+- Fix extra path issue in HttpServletImpl.cpp
+
2006.08.23 Ilya A. Volynets-Evenbakh <ilya@total-knowledge.com>
- Fix few gcc-4 errors and warnings
diff --git a/src/container/HttpServletRequestImpl.cpp b/src/container/HttpServletRequestImpl.cpp
index 9eff32c..2f8b73a 100644
--- a/src/container/HttpServletRequestImpl.cpp
+++ b/src/container/HttpServletRequestImpl.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2004 by Ilya A. Volynets-Evenbakh *
+ * Copyright (C) 2004-2006 by Ilya A. Volynets-Evenbakh *
* ilya@total-knowledge.com *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -570,11 +570,11 @@ long HttpServletRequestImpl::getDateHea
if(hval.empty())
return -1;
struct tm out;
- if(strptime(hval.c_str(), "%a, %d %m %Y %H:%M:%S GMT", &out) ||
+ if(strptime(hval.c_str(), "%a, %d %b %Y %H:%M:%S GMT", &out) ||
strptime(hval.c_str(), "%A, %d-%m-%y %H:%M:%S GMT", &out) ||
strptime(hval.c_str(), "%a %m %d %H:%M:%S %Y GMT", &out))
return mktime(&out);
- return -1;
+ throw servlet::ServletException("IllegalArgumentException");
}
std::string HttpServletRequestImpl::getHeader(const std::string& name) const
{
--
1.4.2