X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2FDEVEL%2Focaml-http%2Fhttp_request.ml;h=93e6d88118f16ce16c8e13719da71569c9e29736;hb=9b1b59a049935f5382ed7def91b807bbf9453894;hp=cd2dcd16563f8dfdd1139ba951e8720e54520dae;hpb=d43522a6d38fcb9081a3f0352088377bc0555231;p=helm.git diff --git a/helm/software/DEVEL/ocaml-http/http_request.ml b/helm/software/DEVEL/ocaml-http/http_request.ml index cd2dcd165..93e6d8811 100644 --- a/helm/software/DEVEL/ocaml-http/http_request.ml +++ b/helm/software/DEVEL/ocaml-http/http_request.ml @@ -1,8 +1,7 @@ - (* OCaml HTTP - do it yourself (fully OCaml) HTTP daemon - Copyright (C) <2002-2005> Stefano Zacchiroli + Copyright (C) <2002-2007> Stefano Zacchiroli This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as @@ -75,6 +74,18 @@ class request ic = in (headers, body)) in + let cookies = + try + let _hdr, raw_cookies = + List.find + (fun (hdr, _cookie) -> String.lowercase hdr = "cookie") + headers + in + Some (Http_parser.parse_cookies raw_cookies) + with + | Not_found -> None + | Malformed_cookies _ -> None + in let query_post_params = match meth with | `POST -> @@ -122,6 +133,8 @@ class request ic = method params_GET = query_get_params method params_POST = query_post_params + method cookies = cookies + method private fstLineToString = let method_string = string_of_method self#meth in match self#version with