awkward / Ocarina

A library to get metadata and Open Graph information from URLs
MIT License
38 stars 13 forks source link

404 status code does not give a failure #10

Closed thierrybucco closed 4 years ago

thierrybucco commented 4 years ago

In OcarinaManager in taskDidComplete receiving a 404 statusCode will not execute failure block.

if let response = response, response.statusCode < 200 && response.statusCode >= 300 {

it should be response.statusCode < 200 || response.statusCode >= 300

Also it would be nice to expose HTTPURLResponse in error.UserInfo

renssies commented 4 years ago

That was a good catch, I've approved and merged your PR: https://github.com/awkward/Ocarina/pull/11

thierrybucco commented 4 years ago

Thanks!