File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ let signal_waiter =
2222 waiter
2323
2424let main o =
25- Printf. printf " ROOT_URL: \" %s\"\n %!" o.root_url ;
25+ Printf. printf " ROOT_URL: \" %s\"\n %!" o.base_url ;
2626 Printf. printf " Learnocaml server v.%s starting on port %d\n %!"
2727 Learnocaml_api. version o.port;
2828 if o.base_url <> " " then
Original file line number Diff line number Diff line change @@ -1166,7 +1166,7 @@ let launch () =
11661166 then Server. respond ~status: `Not_modified ~body: Cohttp_lwt.Body. empty ()
11671167 else
11681168 (match req.Request. meth with
1169- | `GET -> lwt_ok {Api. meth = `GET ; host = ! root_url ; path; args}
1169+ | `GET -> lwt_ok {Api. meth = `GET ; host = ! base_url ; path; args}
11701170 | `POST ->
11711171 begin
11721172 Cohttp_lwt.Body. to_string body
@@ -1180,11 +1180,11 @@ let launch () =
11801180 List. assoc_opt " csrf" cookies with
11811181 | Some (param_csrf :: _ ), Some cookie_csrf ->
11821182 if Eqaf. equal param_csrf cookie_csrf then
1183- lwt_ok {Api. meth = `POST params; host = ! root_url ; path; args}
1183+ lwt_ok {Api. meth = `POST params; host = ! base_url ; path; args}
11841184 else
11851185 lwt_fail (`Forbidden , " CSRF token mismatch" )
11861186 | None , None | None , Some _ ->
1187- lwt_ok {Api. meth = `POST params; host = ! root_url ; path; args}
1187+ lwt_ok {Api. meth = `POST params; host = ! base_url ; path; args}
11881188 | _ , _ ->
11891189 lwt_fail (`Forbidden , " Bad CSRF token" )
11901190 end
You can’t perform that action at this time.
0 commit comments