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

Rewrite get_robotstxt_http_get #94

Merged
merged 2 commits into from
Nov 15, 2024
Merged

Conversation

jrdnbradford
Copy link
Contributor

@jrdnbradford jrdnbradford commented Nov 13, 2024

Closes #93. The user-agent header by default is set to

 user_agent = utils::sessionInfo()$R.version$version.string

which results in something like R version 4.4.1 (2024-06-14).

The function explicitly adds the header if user_agent is not NULL. If NULL is passed for user_agent the header is not explicitly set by the function but a header is still added:

Response [https://httpbin.org/user-agent]
  Date: 2024-11-14 12:46
  Status: 200
  Content-Type: application/json
  Size: 60 B
{
  "user-agent": "libcurl/8.7.1 r-curl/5.2.3 httr/1.4.7"
}

So as is, the if/else check doesn't do any work and can be dropped.

@jrdnbradford jrdnbradford merged commit d3d0a4d into main Nov 15, 2024
8 checks passed
@jrdnbradford jrdnbradford deleted the simplify-get_robotstxt_http_get branch November 15, 2024 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rewrite/simplify get_robotstxt_http_get
1 participant