Skip to content

Commit ab2f47d

Browse files
committed
fix: bug introduced by the merge
1 parent f429321 commit ab2f47d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/learnocaml_server_main.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let signal_waiter =
2222
waiter
2323

2424
let 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

src/server/learnocaml_server.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)