package dream

  1. Overview
  2. Docs

Source file tag.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#1 "src/server/tag.eml.ml"
(* This file is part of Dream, released under the MIT license. See LICENSE.md
   for details, or visit https://github.com/aantron/dream.

   Copyright 2021 Anton Bachin *)



module Dream =
struct
  include Dream_pure
  include Dream_pure.Formats
end
(* This slightly awkward simulation of the overall Dream module using a
   composition of internal modules is necessary to get all the helpers at the
   right positions expected by the EML templater. *)
module Method = Dream_pure.Method


let csrf_tag ~now request =
  let token = Csrf.csrf_token ~now request in
let ___eml_buffer = Buffer.create 4096 in
(Buffer.add_string ___eml_buffer "<input name=\"");
(Printf.bprintf ___eml_buffer "%s" (
#21 "src/server/tag.eml.ml"
                    Csrf.field_name 
));
(Buffer.add_string ___eml_buffer "\" type=\"hidden\" value=\"");
(Printf.bprintf ___eml_buffer "%s" (
#21 "src/server/tag.eml.ml"
                                                                  token 
));
(Buffer.add_string ___eml_buffer "\">\n");
(Buffer.contents ___eml_buffer)
OCaml

Innovation. Community. Security.