X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=DEVEL%2Focaml-http%2Fhttp_request.ml;h=93e6d88118f16ce16c8e13719da71569c9e29736;hb=a3f4c0a8b4328cb9a9fe3b4c2e577be2a258675c;hp=cd2dcd16563f8dfdd1139ba951e8720e54520dae;hpb=d17988855a2e85dc2db641d11ce481c266038ef3;p=helm.git diff --git a/DEVEL/ocaml-http/http_request.ml b/DEVEL/ocaml-http/http_request.ml index cd2dcd165..93e6d8811 100644 --- a/DEVEL/ocaml-http/http_request.ml +++ b/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