+ wip tos

This commit is contained in:
swrup 2026-02-12 07:09:37 +01:00
parent 98ba917cfb
commit 7ccd0ac600
2 changed files with 25 additions and 15 deletions

View file

@ -14,7 +14,7 @@ let select_mimetype headers =
let opt = Vif.Headers.get headers "accept" in
Cohttp.Accept.media_ranges opt
|> Cohttp.Accept.qsort
|> List.find_map (fun (_q, (m, _p)) -> Assets.Mimetype.of_cohttp_media m)
|> List.find_map (fun (_q, (m, _p)) -> Assets.Mimetype.of_cohttp m)
|> function
| None -> Assets.default_mimetype
| Some mime -> mime
@ -24,9 +24,9 @@ let select_language headers =
Cohttp.Accept.languages opt
|> Cohttp.Accept.qsort
|> List.map snd
|> List.find_map Assets.Language.of_cohttp_language
|> List.find_map Assets.Language.of_cohttp
|> function
| None -> Assets.default_lang
| None -> Assets.Language.default
| Some lang -> lang
let select_encoding headers =