New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix url_ok bug, status codes are integers #133

Merged
merged 1 commit into from Aug 22, 2014

Conversation

Projects
None yet
2 participants
@gaborcsardi
Member

gaborcsardi commented Aug 22, 2014

This happens:

url_ok("http://httpbin.org/status/200")
# [1] FALSE

Because status codes are converted to integers here:
https://github.com/hadley/httr/blob/26d986de55c2142e91921a1fd94ad01311e6ebf0/R/perform.R#L66
But the test is against a real number:
https://github.com/hadley/httr/blob/26d986de55c2142e91921a1fd94ad01311e6ebf0/R/response-status.r#L155

Also added some simple tests for this.

hadley added a commit that referenced this pull request Aug 22, 2014

Merge pull request #133 from gaborcsardi/master
Fix url_ok bug, status codes are integers

@hadley hadley merged commit 1c4db3c into r-lib:master Aug 22, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@hadley

This comment has been minimized.

Member

hadley commented Aug 22, 2014

Thanks!

@hadley

This comment has been minimized.

Member

hadley commented Aug 22, 2014

Would you mind also adding a note to NEWS?

@gaborcsardi

This comment has been minimized.

Member

gaborcsardi commented Aug 22, 2014

Sure, I can try. I just don't know when it broke, if it broke since the last release, then probably no NEWS entry is needed. Anyway, I'll take a look.

@gaborcsardi

This comment has been minimized.

Member

gaborcsardi commented Aug 22, 2014

It happened here: b0ab387

@gaborcsardi

This comment has been minimized.

Member

gaborcsardi commented Aug 22, 2014

NEWS: #134

hadley added a commit that referenced this pull request Aug 22, 2014

Merge pull request #134 from gaborcsardi/master
Add news entry for url_ok() fix (#133)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment