Fix GitHub API cache to work with GitHub App authentication
The version of `bradleyfalzon/ghinstallation` which is used to enable GitHub App authentication turned out to add an extra header `application/vnd.github.machine-man-preview+json` to every HTTP request. That revealed an edge-case in our HTTP cache layer `gregjones/httpcache` that results it to not serve responses from cache when it should. There were two problems. One was that it does not support multi-valued header and it only looked for the first value for each header, and another is that it does not support any http.RoundTripper implementation that modifies HTTP request headers in a RoundTrip function call. I fixed it in my fork of httpcache, which is hosted at https://github.com/actions-runner-controller/httpcache. The relevant commits are: - https://github.com/actions-runner-controller/httpcache/commit/70d975e77df1b010ad258cf89a20acdb81a32a51 - https://github.com/actions-runner-controller/httpcache/commit/197a8a354649ce737558f06705b2d809d8d3bcce This can be considered as a follow-up for #1127, which turned out to have enabled the cache only for the case that ARC uses PAT for authentication. Since this fix, the cache is also enabled when ARC authenticates as a GitHub App.
This commit is contained in:
Reference in New Issue
Block a user