diff --git a/internal/witness/client/http/witness_client.go b/internal/witness/client/http/witness_client.go index d146ca3167..a04f55ff23 100644 --- a/internal/witness/client/http/witness_client.go +++ b/internal/witness/client/http/witness_client.go @@ -83,6 +83,10 @@ func (w Witness) Update(ctx context.Context, logID string, sth []byte, proof [][ if err != nil { return nil, fmt.Errorf("failed to do http request: %v", err) } + if resp.Request.Method != "PUT" { + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections#permanent_redirections + return nil, fmt.Errorf("PUT request to %q was converted to %s request to %q", u.String(), resp.Request.Method, resp.Request.URL) + } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil {