emscripten icon indicating copy to clipboard operation
emscripten copied to clipboard

emscripten_async_wget2* status code successful should check 200-299 range, not only == 200

Open ziocleto opened this issue 8 years ago • 2 comments

Hi,

I think this has been fixed already for Fetch API, but functions in the emscripten_async_wget2 family also suffer this bug, in particular at lines that do these kind of check:

if (http.status == 200)

It should really be

if (http.status >=200 && http.status < 300 )

Or just have a isSuccessful(status) function that returns true if within that range.

Cheers, Dado.

ziocleto avatar Nov 30 '18 02:11 ziocleto

Hey, im new here and want to start helping, so I think this one is a good starting point. Can I just take it?

martinakraus avatar Feb 17 '19 20:02 martinakraus

@CodeKittey yes, thanks! We don't have a special process here, if an issue isn't assigned, it's free for anyone to work on. Reading your PR now.

kripken avatar Feb 19 '19 17:02 kripken