X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Focaml-http%2Fhttp_parser_sanity.ml;h=7fe08cf9344fd7f3d8fa598782c8eaa7fe64fa40;hb=4167cea65ca58897d1a3dbb81ff95de5074700cc;hp=8e6ef7d549eb777b5a3992e3b0fc66b651964641;hpb=86751d7b1e404034ac02244aad47f1bf29d9c46b;p=helm.git diff --git a/helm/DEVEL/ocaml-http/http_parser_sanity.ml b/helm/DEVEL/ocaml-http/http_parser_sanity.ml index 8e6ef7d54..7fe08cf93 100644 --- a/helm/DEVEL/ocaml-http/http_parser_sanity.ml +++ b/helm/DEVEL/ocaml-http/http_parser_sanity.ml @@ -2,28 +2,27 @@ (* OCaml HTTP - do it yourself (fully OCaml) HTTP daemon - Copyright (C) <2002> Stefano Zacchiroli + Copyright (C) <2002-2005> Stefano Zacchiroli This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + it under the terms of the GNU Library General Public License as + published by the Free Software Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + GNU Library General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA *) -open Neturl;; -open Printf;; +open Printf -open Http_types;; -open Http_constants;; +open Http_types +open Http_constants (* type url_syntax_option = @@ -34,19 +33,22 @@ type url_syntax_option = * (1) scheme://user:password@host:port/path;params?query#fragment *) -let request_uri_syntax = { - url_enable_scheme = Url_part_not_recognized; - url_enable_user = Url_part_not_recognized; - url_enable_password = Url_part_not_recognized; - url_enable_host = Url_part_not_recognized; - url_enable_port = Url_part_not_recognized; - url_enable_path = Url_part_required; - url_enable_param = Url_part_not_recognized; - url_enable_query = Url_part_allowed; - url_enable_fragment = Url_part_not_recognized; - url_enable_other = Url_part_not_recognized; - url_accepts_8bits = false; - url_is_valid = (fun _ -> true); +let request_uri_syntax = +{ + Neturl.url_enable_scheme = Neturl.Url_part_not_recognized; + url_enable_user = Neturl.Url_part_not_recognized; + url_enable_user_param = Neturl.Url_part_not_recognized; + url_enable_password = Neturl.Url_part_not_recognized; + url_enable_host = Neturl.Url_part_not_recognized; + url_enable_port = Neturl.Url_part_not_recognized; + url_enable_path = Neturl.Url_part_required; + url_enable_param = Neturl.Url_part_not_recognized; + url_enable_query = Neturl.Url_part_allowed; + url_enable_fragment = Neturl.Url_part_not_recognized; + url_enable_other = Neturl.Url_part_not_recognized; + url_accepts_8bits = false; + url_enable_relative = true; + url_is_valid = (fun _ -> true); } (* convention: @@ -106,7 +108,8 @@ let heal_header (name, value) = let url_of_string s = try - url_of_string request_uri_syntax s + Neturl.url_of_string request_uri_syntax s with Neturl.Malformed_URL -> raise (Malformed_URL s) + let string_of_url = Neturl.string_of_url