package cohttp

  1. Overview
  2. Docs
An OCaml library for HTTP clients and servers

Install

dune-project
 Dependency

Authors

Maintainers

Sources

cohttp-6.2.2.tbz
sha256=499cd8b094cee4b00fe6b9f6322680f81fe87161e963a196b109c1882610af62
sha512=701b946af0a84c9f5d1f5131fc4cea9b35fa2fd18d67460eb0caf4f916acc4ae8695d65594d0e0074f2729dc9ca54cfd984b1863a6f7dc345e171be4e3c3b258

doc/src/cohttp/path.ml.html

Source file path.ml

1
2
3
4
5
6
7
let resolve_local_file ~docroot ~uri =
  let path = Uri.(pct_decode (path (resolve "http" (of_string "/") uri))) in
  let rel_path =
    if String.length path > 0 then String.sub path 1 (String.length path - 1)
    else ""
  in
  Filename.concat docroot rel_path