From 23db42fed3fe06b64b829117a66004300cbc5585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Fri, 20 Dec 2024 10:13:30 +0100 Subject: [PATCH] Rely on redirect also for Accept: json --- lib/builder_web.ml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/builder_web.ml b/lib/builder_web.ml index 9ba75ac..b686262 100644 --- a/lib/builder_web.ml +++ b/lib/builder_web.ml @@ -330,18 +330,9 @@ let routes ~datadir ~cachedir ~configdir ~expired_jobs = Dream.sql req (Model.latest_successful_build_uuid job_id platform)) >>= Model.not_found |> if_error "Error getting job" >>= fun build -> - match Dream.header req "Accept" with - | Some accept when String.starts_with ~prefix:"application/json" accept -> - let json_response = - `Assoc [ - "uuid", `String (Uuidm.to_string build); - ] |> Yojson.Basic.to_string - in - Dream.json ~status:`OK json_response |> Lwt_result.ok - | _ -> - Dream.redirect req - (Link.Job_build_artifact.make_from_string ~job_name ~build ~artifact ()) - |> Lwt_result.ok + Dream.redirect req + (Link.Job_build_artifact.make_from_string ~job_name ~build ~artifact ()) + |> Lwt_result.ok in let redirect_latest req =