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

Custom headers in HTTP, use headers for basic auth #256

Merged
merged 6 commits into from
Nov 20, 2018

Conversation

gaborcsardi
Copy link
Member

@gaborcsardi gaborcsardi commented Nov 20, 2018

BitBucket does not support Basic Auth via URL encoding,
apparently. So we use HTTP headers instead. This is somewhat
tricky, because base R download.file()) does not allow
that directly. We need to shadow an internal function in utils,
and also make use of some bugs in curl and the internal
download methods, that let you specify multiple HTTP headers
via the User-Agent option.

This will also fix #255.

This PR also changes the default download method, slightly.
The default download method now respects the
download.file.method user option, if set.
Otherwise, if libcurl is supported, it will be
selected. (Before, wininet was preferred on Windows,
because it sets the proxies automatically, see #46.)

@gaborcsardi
Copy link
Member Author

@jimhester I still need to update the NEWS, and add some more docs, but otherwise I think this is good.

BitBucket does not support Basic Auth via URL encoding,
apparently. So we use HTTP headers instead. This is somewhat
tricky, because base R  download.file()) does not allow
that directly. We need to shadow an internal function in utils,
and also make use of a bugs in curl and the internal
download methods, that let you specify multiple HTTP headers
via the User-Agent option.

This will also fix #255.
It does not support HTTPS.
The default download method now respects the
`download.file.method` user option, if set.

Otherwise, if libcurl is supported, it will be
selected. (Before, wininet was preferred on Windows,
because it sets the proxies automatically, see #46.)
@gaborcsardi gaborcsardi force-pushed the fix/http-headers-auth branch from 38b7259 to c4626ec Compare November 20, 2018 14:31
@gaborcsardi
Copy link
Member Author

OK, added NEWS and docs.

@jimhester
Copy link
Member

It looks fine, thanks!

HTTP in base R is quite a mess ☹️

@gaborcsardi
Copy link
Member Author

Thanks!

@gaborcsardi gaborcsardi merged commit 254c67e into master Nov 20, 2018
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.

Can't install private bitbucket repos
2 participants