Skip to content

Commit 98df03a

Browse files
committed
Outputfiler: use string fro regexp
1 parent 61acd28 commit 98df03a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/extensions/outputfilter.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020

2121
(* This module enables rewritting the server output *)
2222

23-
type header_filter =
24-
[ `Rewrite of Ocsigen_header.Name.t * Re.Pcre.regexp * string
25-
| `Add of Ocsigen_header.Name.t * string * bool option ]
26-
2723
let gen filter = function
2824
| Ocsigen_extensions.Req_not_found (code, _) ->
2925
Lwt.return (Ocsigen_extensions.Ext_next code)
@@ -117,4 +113,8 @@ let () =
117113
()
118114

119115
let run ~mode () _ _ _ =
120-
match mode with `Code c -> gen_code c | #header_filter as f -> gen f
116+
match mode with
117+
| `Code c -> gen_code c
118+
| `Rewrite (header, regexp, dest) ->
119+
gen (`Rewrite (header, Re.Pcre.regexp ("^" ^ regexp ^ "$"), dest))
120+
| `Add f -> gen (`Add f)

src/extensions/outputfilter.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This module belongs to ocamlfind package
1414

1515
val run :
1616
mode:
17-
[ `Rewrite of Ocsigen_header.Name.t * Re.Pcre.regexp * string
17+
[ `Rewrite of Ocsigen_header.Name.t * string * string
1818
| `Add of Ocsigen_header.Name.t * string * bool option
1919
| `Code of Cohttp.Code.status ]
2020
-> unit

0 commit comments

Comments
 (0)