Dnia 2008-07-16, śro o godzinie 09:29 +0200, Edi Weitz pisze:

> Looks fine to me except that it's lacking the HTML documentation
> patch.
> 
>   http://weitz.de/patches.html

Whoops, I'm sorry.  I omitted it, thinking that DOCUMENTATION-TEMPLATE
would somehow automatically include the doc for new variable.  Do you
maintain the Drakma doc by hand?

In any case, the attached patch is a second attempt.  I changed the
docstring of *ALLOW-DOTLESS-COOKIE-DOMAINS-P* to be a little more
elaborate and moved its definition to specials.lisp.  Is that OK?

-- 
Daniel Janus     <[EMAIL PROTECTED]>
Quality Assurance Specialist, SENTIVISION
Mb: +48 501 180 396 | Ph: +48 22 640 0860
Index: cookies.lisp
===================================================================
--- cookies.lisp	(wersja 3452)
+++ cookies.lisp	(kopia robocza)
@@ -93,8 +93,10 @@
 
 (defun valid-cookie-domain-p (domain)
   "Checks if the string DOMAIN contains enough dots to be
-acceptable."
-  (or (string-equal domain "localhost")
+acceptable.  If *ALLOW-DOTLESS-COOKIE-DOMAINS-P* is non-NIL,
+every domain name is considered acceptable."
+  (or *allow-dotless-cookie-domains-p*
+      (string-equal domain "localhost")
       (> (count #\. (normalize-cookie-domain domain) :test #'char=) 1)))
 
 (defun cookie-domain-matches (domain uri)
Index: packages.lisp
===================================================================
--- packages.lisp	(wersja 3452)
+++ packages.lisp	(kopia robocza)
@@ -33,7 +33,8 @@
   (:use :cl :puri :flexi-streams :chunga)
   ;; the variable defined in the ASDF system definition
   (:import-from :drakma-asd :*drakma-version-string*)
-  (:export :*body-format-function*
+  (:export :*allow-dotless-cookie-domains-p*
+           :*body-format-function*
            :*drakma-default-external-format*
            :*header-stream*
            :*ignore-unparseable-cookie-dates-p*
Index: doc/index.html
===================================================================
--- doc/index.html	(wersja 3452)
+++ doc/index.html	(kopia robocza)
@@ -84,6 +84,7 @@
           <li><a href="#cookie-jar-cookies"><code>cookie-jar-cookies</code></a>
           <li><a href="#cookie="><code>cookie=</code></a>
           <li><a href="#delete-old-cookies"><code>delete-old-cookies</code></a>
+          <li><a href="#*allow-dotless-cookie-domains-p*"><code>*allow-dotless-cookie-domains-p*</code></a>
           <li><a href="#*ignore-unparseable-cookie-dates-p*"><code>*ignore-unparseable-cookie-dates-p*</code></a>
         </ol>
       <li><a href="#headers">Headers</a>
@@ -1261,6 +1262,20 @@
 <!-- End of entry for DELETE-OLD-COOKIES -->
 
 
+<!-- Entry for *ALLOW-DOTLESS-COOKIE-DOMAINS-P* -->
+
+<p><br>[Special variable]<br><a class=none name='*allow-dotless-cookie-domains-p*'><b>*allow-dotless-cookie-domains-p*</b></a>
+<blockquote><br>
+
+When this variable is not <code>NIL</code>, cookie domains containing
+no dots are considered valid.  The default is <code>NIL</code>,
+meaning to disallow such domains.
+
+</blockquote>
+
+<!-- End of entry for *ALLOW-DOTLESS-COOKIE-DOMAINS-P* -->
+
+
 <!-- Entry for *IGNORE-UNPARSEABLE-COOKIE-DATES-P* -->
 
 <p><br>[Special variable]<br><a class=none name='*ignore-unparseable-cookie-dates-p*'><b>*ignore-unparseable-cookie-dates-p*</b></a>
Index: specials.lisp
===================================================================
--- specials.lisp	(wersja 3452)
+++ specials.lisp	(kopia robocza)
@@ -70,6 +70,11 @@
 which incoming and outgoing headers will be written for debugging
 purposes.")
 
+(defvar *allow-dotless-cookie-domains-p* nil
+  "When this variable is not NIL, cookie domains containing no dots
+are considered valid.  The default is NIL, meaning to disallow such
+domains.")
+
 (defvar *ignore-unparseable-cookie-dates-p* nil
   "Whether Drakma is allowed to treat `Expires' dates in cookie
 headers as non-existent if it can't parse them.  If the value of this
_______________________________________________
drakma-devel mailing list
drakma-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel

Reply via email to