Skip to content
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
Merged

Fix url_ok bug, status codes are integers #133

merged 1 commit into from
Aug 22, 2014

Conversation

gaborcsardi
Copy link
Member

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
Fix url_ok bug, status codes are integers
@hadley hadley merged commit 1c4db3c into r-lib:master Aug 22, 2014
@hadley
Copy link
Member

hadley commented Aug 22, 2014

Thanks!

@hadley
Copy link
Member

hadley commented Aug 22, 2014

Would you mind also adding a note to NEWS?

@gaborcsardi
Copy link
Member Author

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
Copy link
Member Author

It happened here: b0ab387

@gaborcsardi
Copy link
Member Author

NEWS: #134

hadley added a commit that referenced this pull request Aug 22, 2014
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants