fix(data_source_github_release_asset): Fix #2514 remove accept header…#3186
fix(data_source_github_release_asset): Fix #2514 remove accept header…#3186felipebraga wants to merge 1 commit intointegrations:mainfrom
Conversation
…ccept header that's cause http error 406 Not Acceptable when try to download the asset
|
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with |
|
CC @mdb |
|
@felipebraga what are your thoughts on the other changes introduced in #2514 related to setting the header? I would think that they should also be reverted? |
@felipebraga Are you able to provide a specific release asset example where this can be reproduced? You may be onto something, though acceptance tests seemingly continue to pass both with and without the header handling changes introduced in #2514. So, it'd be good to have a more clear sense of the 406's cause. (Also, given #2514 was originally opened in 2024, it's possible a subsequent upgrade to https://github.com/google/go-github has made the header handling intro'd by #2514 unnecessary altogether; I just want to be sure) |
| repository = "example-repository" | ||
| owner = "example-owner" | ||
| asset_id = 12345 | ||
| download_file = true |
Resolves #2514 and #2513
Fixes #2514 remove accept header that's cause http error
406 Not Acceptablewhen trying to download the asset.The new data source
github_release_assetintroduced in provider version 6.11, which adds the functionality to download the file asset, but it wasn't working due to thereq.Header.Set("Accept", "application/octet-stream")which was causing the GitHub API to return a406 Not Acceptable.Before the change?
github_release_assetreturns406 Not Acceptablewhen trying to download the asset.After the change?
github_release_assetis able to download the specified asset.Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!