From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id CADEEBC6B for ; Thu, 24 Jan 2008 17:23:25 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKpKmEeDrhCRh2dsb2JhbACQJAEBAQgKKYEUnVI X-IronPort-AV: E=Sophos;i="4.25,244,1199660400"; d="scan'208";a="6532072" Received: from discorde.inria.fr ([192.93.2.38]) by mail2-smtp-roc.national.inria.fr with ESMTP; 24 Jan 2008 17:23:25 +0100 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m0OGNPjd007224 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 24 Jan 2008 17:23:25 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKpKmEeDrhCRh2dsb2JhbACQJAEBAQgKKYEUnVI X-IronPort-AV: E=Sophos;i="4.25,244,1199660400"; d="scan'208";a="6532071" Received: from smeltpunt.science.ru.nl ([131.174.16.145]) by mail2-smtp-roc.national.inria.fr with ESMTP; 24 Jan 2008 17:23:25 +0100 Received: from tandem.cs.ru.nl (tandem.cs.ru.nl [131.174.142.18]) by smeltpunt.science.ru.nl (8.13.7/5.23) with ESMTP id m0OGNOTs026646 for ; Thu, 24 Jan 2008 17:23:24 +0100 (MET) Received: from tews by tandem.cs.ru.nl with local (Exim 4.63) (envelope-from ) id 1JI4rM-0000Xt-Jf for caml-list@inria.fr; Thu, 24 Jan 2008 17:23:24 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18328.47996.575042.540380@tandem.cs.ru.nl> Date: Thu, 24 Jan 2008 17:23:24 +0100 To: caml-list@inria.fr Subject: netclient: cookie names with + (or spaces) X-Mailer: VM 7.19 under Emacs 21.4.1 From: Hendrik Tews X-Scanned-By: MIMEDefang 2.63 on 131.174.16.145 X-Miltered: at discorde with ID 4798BB7D.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; netclient:01 hendrik:01 tews:01 tews:01 netclient:01 regexp:01 pcre:01 regexp:01 netencoding:01 netencoding:01 hendrik:01 cookie:98 curl:98 cookie:98 curl:98 Hi, mailman seems to give out cookies with names that contain ``+''. When I do curl -c ... or look into firefox I see ``robin-cvs-commits+admin'' as cookie name. It might also be that curl and firefox are buggy and the name is really ``robin-cvs-commits admin''. There are several fixes needed in netclient to work with such cookies. First One has to add ``+'' in the name regexp for get_set_cookie (see https://godirepo.camlcity.org/wwwsvn/trunk/code/get-set-cookie.ml?rev=1145&root=lib-ocamlnet2&view=auto which I got in http://caml.inria.fr/pub/ml-archives/caml-list/2007/08/59604682c9ef4918bb532a576e7db86c.en.html) : let nv_re = Pcre.regexp "^([-a-zA-Z0-9_.+]+)(=(.*))?$" This way I get robin-cvs-commits+admin as cookie name, but when I set it Nethttp.Header.set_cookie the ``+'' is encoded and the cookie is not recognized by mailman. I worked around this rather clumsy: (if c.Nethttp.cookie_name = "robin-cvs-commits+admin" then "robin-cvs-commits admin" else c.Nethttp.cookie_name) Another possibility is to change in get_set_cookie { Nethttp.cookie_name = Netencoding.Url.decode ~plus:false n; to { Nethttp.cookie_name = Netencoding.Url.decode ~plus:true n; this way I get of course ``robin-cvs-commits admin'' as cookie name. I believe get_set_cookie should be in sync with set_cookie. Therefore, which one is wrong? Must/are cookie names be URL-encoded in the header? Bye, Hendrik