ApeWorX / ethpm-types

Implementation of EIP-2678
Apache License 2.0
14 stars 8 forks source link

Verify the status code on fetching sources #18

Closed fubuloubu closed 2 years ago

fubuloubu commented 2 years ago

We should verify the status code on this response before continuing, using requests or something

_Originally posted by @unparalleled-js in https://github.com/ApeWorX/ethpm-types/pull/17#discussion_r803109780_

p.s. this needs a lot more thought

fubuloubu commented 2 years ago

closed by #17

antazoey commented 2 years ago

I see it checks response.status_code == 200 but technically anything in the 200 range is valid. Probably better to do 200 <= response.status_code < 300.

fubuloubu commented 2 years ago

I see it checks response.status_code == 200 but technically anything in the 200 range is valid. Probably better to do 200 <= response.status_code < 300.

I don't think anything other than 200 would be useful for our purposes: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#successful_responses