fix(tiny-httpd-vfs-pack): allow redirections when fetching resources

This commit is contained in:
Simon Cruanes 2022-04-03 22:57:39 -04:00
parent 7d74dacbea
commit c8d89e24be
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -53,7 +53,7 @@ let emit oc (l:entry list) : unit =
| Url (vfs_path, url) -> | Url (vfs_path, url) ->
if !verbose then Printf.eprintf "add url %S = %S\n%!" vfs_path url; if !verbose then Printf.eprintf "add url %S = %S\n%!" vfs_path url;
begin match Curly.get url with begin match Curly.get ~args:["-L"] url with
| Ok b -> | Ok b ->
let code = b.Curly.Response.code in let code = b.Curly.Response.code in
if code >= 200 && code < 300 then ( if code >= 200 && code < 300 then (