merge with upstream

This commit is contained in:
Stavros Polymenis 2016-09-11 14:26:20 +01:00
commit 6488fea2a4

View File

@ -1,5 +1,8 @@
open Opium.Std
let sanitised_path path =
let parent = Str.regexp "\.\./" in
Str.global_replace parent "" path
let print_css =
get "/style.css"
@ -10,7 +13,7 @@ let print_css =
let print_ymd =
get "/:title"
begin fun req ->
let filename = String.map (fun c -> if '/' = c then '_' else c) (param req "title") in
let filename = sanitised_path (param req "title") in
let filepath = "ymd/" ^ filename ^ ".ymd" in
`Html (Html.html_of (Logarion.ymd filepath)) |> respond'
end