123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172# 1 "src/lib/eliom_service.client.ml"(* Ocsigen
* http://www.ocsigen.org
* Copyright (C) 2010 Vincent Balat
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, with linking exception;
* either version 2.1 of the License, or (at your option) any later version.
*
* 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*)includeEliom_service_baseletxhr_with_cookiess=ifis_externalsthenNoneelsematchs.send_appl_contentwith|XAlways->SomeNone|XNever->None|XSame_appl(appl,_)whenappl<>Eliom_process.get_application_name()->None|XSame_appl(_,tmpl)->Sometmplletclient_funservice=matchservice.client_funwithSomef->!f|None ->Nonelethas_client_funservice=client_funservice<>Noneletset_client_fun?app~servicef=Eliom_lib.Option.iter(funname->service.send_appl_content<-XSame_appl(name,None))app;matchservice.client_funwith|Somer->r:=Somef|None->service.client_fun<-Some(ref(Somef))letreload_fun:typegppp.(gp,pp,_,_,_,_,_,_,_,_,_)t->(gp->unit->resultLwt.t)option=funservice->matchEliom_parameter.is_unit(post_params_typeservice)with|Eliom_parameter.U_yes->(matchservicewith|{client_fun=Some{contents=Somef};reload_fun=Rf_client_fun;_}->Somef|_->None)|_->Noneletreset_reload_funservice=service.reload_fun<-Rf_keepletregister_delayed_get_or_na_coservice~sp:__=failwith"CSRF coservice not implemented client side for now"letregister_delayed_post_coservice~sp:___getname=failwith"CSRF coservice not implemented client side for now"moduleCohttp=structmoduleHeader=structtypetendend