chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] http-client and set-cookie


From: Peter Bex
Subject: Re: [Chicken-users] http-client and set-cookie
Date: Thu, 13 Jan 2011 21:19:08 +0100
User-agent: Mutt/1.4.2.3i

On Fri, Jan 14, 2011 at 12:55:41AM +0900, Daishi Kato wrote:
> Hi Peter,

Hello Daishi,

> It gives me:
> Error: bad argument type - not a structure of the required type
> (/ "xxxxxxx" "")
> URI-common
> 
> It seems like it fails in path-match? in process-set-cookie!.

I think I see what you mean. I don't have any URL that responds in
a way that triggers the bug for me, though :(

> I'm not totally sure, but could it be something like this?

Have you tested this patch?  Does it work for you?

It seems wrong to me, since the set-cookie-parser parses path components
into relative references (ie, uri-common objects).

Could you test this patch instead?

@@ -287,7 +287,7 @@
          (lambda (host pattern)
            (string-index host #\. 0 (string-contains-ci host pattern)))))
     (for-each (lambda (c)
-                (and-let* ((path (or (get-param 'path c) (uri-path uri)))
+                (and-let* ((path (or (get-param 'path c) uri))
                            ((path-match? uri path))
                            ;; domain must start with dot. Add to intarweb!
                            (dn (get-param 'domain c (uri-host uri)))
@@ -300,7 +300,7 @@
               (header-contents 'set-cookie (response-headers r) '()))
     (for-each (lambda (c)
                 (and-let* (((get-param 'version c)) ; required for set-cookie2
-                           (path (or (get-param 'path c) (uri-path uri)))
+                           (path (or (get-param 'path c) uri))
                            ((path-match? uri path))
                            (dn (get-param 'domain c (uri-host uri)))
                            ((or (string-ci=? dn ".local")

If it works, please let me know so I can make a release containing
this patch.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth



reply via email to

[Prev in Thread] Current Thread [Next in Thread]