Skip to content

Commit

Permalink
Rewind filehandle request bodies before retrying requests
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed May 22, 2024
1 parent 722f1b6 commit 1910e8a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dandi/dandiapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ def request(
url,
result.text,
)
if data is not None and hasattr(data, "seek"):
data.seek(0)

Check warning on line 237 in dandi/dandiapi.py

View check run for this annotation

Codecov / codecov/patch

dandi/dandiapi.py#L237

Added line #L237 was not covered by tests
result.raise_for_status()
except Exception as e:
if isinstance(e, requests.HTTPError):
Expand Down

0 comments on commit 1910e8a

Please sign in to comment.