Skip to content

Adding the header option to CurlDownloadStrategy.#6545

Merged
MikeMcQuaid merged 2 commits into
Homebrew:masterfrom
maboloshi:patch-1
Oct 7, 2019
Merged

Adding the header option to CurlDownloadStrategy.#6545
MikeMcQuaid merged 2 commits into
Homebrew:masterfrom
maboloshi:patch-1

Conversation

@maboloshi

@maboloshi maboloshi commented Oct 7, 2019

Copy link
Copy Markdown
Contributor

e.g.
It's easy to access github private resources later through specific header settings.

cask 'XXXX' do
...
  url "https://raw.githubusercontent.com/....",
      header: "Authorization: token #{ENV['HOMEBREW_GITHUB_API_TOKEN']}"
...
end

Write the following code, such as ~/.bashrc, ~/.zshrc, etc.

export HOMEBREW_GITHUB_API_TOKEN=<personal access token>

<personal access token>: A personal access token for the GitHub API, requires
repo access permission
(full control of private repositories).


  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew tests with your changes locally?

It's easy to access github private resources later through specific `header` settings.
e.g.
```
cask 'XXXX' do
...
  url "https://raw.githubusercontent.com/....",
      header : "Authorization: token #{ENV['HOMEBREW_GITHUB_API_TOKEN']}"
...
end
 ```

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me. @reitermarkus?

Comment thread Library/Homebrew/download_strategy.rb Outdated
@MikeMcQuaid
MikeMcQuaid merged commit dc35cf4 into Homebrew:master Oct 7, 2019
@MikeMcQuaid

Copy link
Copy Markdown
Member

Thanks so much for your first contribution! Without people like you submitting PRs we couldn't run this project. You rock, @maboloshi!

@maboloshi
maboloshi deleted the patch-1 branch October 7, 2019 11:46
reitermarkus pushed a commit to Homebrew/homebrew-cask that referenced this pull request Oct 7, 2019
@lock lock Bot added the outdated PR was locked due to age label Jan 1, 2020
@lock lock Bot locked as resolved and limited conversation to collaborators Jan 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated PR was locked due to age

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants