diff --git a/lib/builder_web.ml b/lib/builder_web.ml index 7754bf8..41ba400 100644 --- a/lib/builder_web.ml +++ b/lib/builder_web.ml @@ -673,13 +673,11 @@ let error_template error _debug_info suggested_response = | None -> "?" | Some req -> Dream.target req in let referer = - error.Dream.request - |> Option.map (fun req -> Dream.header req "referer") - |> Option.value ~default:None + Option.bind error.Dream.request (fun req -> Dream.header req "referer") in let html = if is_iframe_page ~req:error.Dream.request then - Views.viz_not_found ~target + Views.viz_not_found else Views.page_not_found ~target ~referer in diff --git a/lib/views.ml b/lib/views.ml index b90459a..5498b21 100644 --- a/lib/views.ml +++ b/lib/views.ml @@ -235,7 +235,7 @@ let page_not_found ~target ~referer = ) |> layout ~title:"Page not found" -let viz_not_found ~target = +let viz_not_found = let title = "Visualization not found" in let content = [