From 1c981816217aeffc2384bfd244cec670571a6be7 Mon Sep 17 00:00:00 2001 From: Johanna Larsson Date: Mon, 27 Jul 2026 18:18:08 +0100 Subject: [PATCH] Disable following redirects for POSTs Technically things like retrieving a DID document should never redirect, but I'm being less strict on that since it might be awkward for web DIDs that have redirects on the subdomain. Maybe it's not an issue? Anyway, we can be stricter on `post_form` and `request` in `HTTP`. --- lib/latch/http.ex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/latch/http.ex b/lib/latch/http.ex index 2a4e842..ac6641d 100644 --- a/lib/latch/http.ex +++ b/lib/latch/http.ex @@ -56,7 +56,8 @@ defmodule Latch.HTTP do form: form, headers: headers, decode_body: false, - receive_timeout: @receive_timeout + receive_timeout: @receive_timeout, + redirect: false ] case Req.post(options) do @@ -82,7 +83,8 @@ defmodule Latch.HTTP do url: url, headers: headers, decode_body: false, - receive_timeout: @receive_timeout + receive_timeout: @receive_timeout, + redirect: false ] case Req.request(put_body(options, body)) do -- 2.51.2