Skip to content

Commit

Permalink
pay attention to status code; check if this follows redirects?
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Sep 4, 2022
1 parent bd65a1e commit 0d7e715
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/sourmash/sourmash_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,12 @@ def _load_http_get(filename, **kwargs):

req = requests.get(filename, stream=True)

Check warning on line 373 in src/sourmash/sourmash_args.py

View check run for this annotation

Codecov / codecov/patch

src/sourmash/sourmash_args.py#L373

Added line #L373 was not covered by tests

# load from req.raw as LinearIndex, then pass into MultiIndex to
# generate a manifest.
lidx = LinearIndex.load(req.raw, filename=filename)
db = MultiIndex.load((lidx,), (None,), parent=None)
# CTB: does this follow redirects?
if req.status_code == 200:
# load from req.raw as LinearIndex, then pass into MultiIndex to
# generate a manifest.
lidx = LinearIndex.load(req.raw, filename=filename)
db = MultiIndex.load((lidx,), (None,), parent=None)

Check warning on line 380 in src/sourmash/sourmash_args.py

View check run for this annotation

Codecov / codecov/patch

src/sourmash/sourmash_args.py#L379-L380

Added lines #L379 - L380 were not covered by tests

return db

Expand Down

0 comments on commit 0d7e715

Please sign in to comment.