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

Allow binary content downloads of assets #990

Merged
merged 1 commit into from
Apr 4, 2021

Conversation

acrobat
Copy link
Collaborator

@acrobat acrobat commented Mar 28, 2021

For this to work I also had to change the way the default accept header, previously the header was appended which produced actually an incorrect accept header.

Previously is produced this (this was the same with preview headers being set):

Host: api.github.com
Accept: application/octet-stream
Accept: application/vnd.github.v3+json
User-Agent: php-github-api (http://github.com/KnpLabs/php-github-api)

With the default headers plugin being used

Host: api.github.com
Accept: application/octet-stream
User-Agent: php-github-api (http://github.com/KnpLabs/php-github-api)

Fixes #320

*/
public function show($username, $repository, $id)
public function show($username, $repository, $id, bool $returnBinaryContent = false)
Copy link
Contributor

Choose a reason for hiding this comment

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

missing phpdoc :)

Copy link
Collaborator Author

@acrobat acrobat Mar 28, 2021

Choose a reason for hiding this comment

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

I didn't add it because it's fully documented in the typehint 😄

@acrobat acrobat merged commit 5c540ae into KnpLabs:master Apr 4, 2021
@acrobat acrobat deleted the binary-asset-downloads branch April 4, 2021 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support application/octet-stream for binary asset streaming
2 participants