Browse Source

2007-07-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

	Fixed the bug that prevents cookies from being sent to the 
server
	if the domain of cookie is FQDN and starts with ".".
	* src/Cookie.cc (match)
Tatsuhiro Tsujikawa 18 years ago
parent
commit
6e7893c848
2 changed files with 7 additions and 1 deletions
  1. 6 0
      ChangeLog
  2. 1 1
      src/Cookie.cc

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2007-07-20  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
+
+	Fixed the bug that prevents cookies from being sent to the server
+	if the domain of cookie is FQDN and starts with ".".
+	* src/Cookie.cc (match)
+
 2007-07-18  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
 
 	Fixed the bug that prevents filename in content-disposition from

+ 1 - 1
src/Cookie.cc

@@ -38,7 +38,7 @@
 bool Cookie::match(const string& host, const string& dir, time_t date, bool secure) const
 {
   if((secure || !this->secure && !secure) &&
-     Util::endsWith(host, this->domain) &&
+     Util::endsWith("."+host, this->domain) &&
      Util::startsWith(dir, this->path) &&
      (this->onetime || date < this->expires)) {
     return true;