From 1910e8a708e22670c9f6f4cfa1f6a3cf8c38f2d9 Mon Sep 17 00:00:00 2001 From: "John T. Wodder II" Date: Wed, 22 May 2024 18:51:39 -0400 Subject: [PATCH] Rewind filehandle request bodies before retrying requests --- dandi/dandiapi.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dandi/dandiapi.py b/dandi/dandiapi.py index a7169c3af..9fb7af431 100644 --- a/dandi/dandiapi.py +++ b/dandi/dandiapi.py @@ -233,6 +233,8 @@ def request( url, result.text, ) + if data is not None and hasattr(data, "seek"): + data.seek(0) result.raise_for_status() except Exception as e: if isinstance(e, requests.HTTPError):