Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion githubapp/client_creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ func noStoreServerErrors(next http.RoundTripper) http.RoundTripper {
// Preserve existing Cache-Control directives.
cacheControl := resp.Header.Get("Cache-Control")
// Don't add a no-store directive if it already exists.
for _, directive := range strings.Split(cacheControl, ",") {
for directive := range strings.SplitSeq(cacheControl, ",") {
if strings.TrimSpace(directive) == "no-store" {
return resp, err
}
Expand Down
5 changes: 2 additions & 3 deletions githubapp/client_creator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package githubapp

import (
"io"
"maps"
"net/http"
"net/http/httptest"
"testing"
Expand Down Expand Up @@ -121,9 +122,7 @@ type cacheTestResponse struct {

func newCacheTestResponse(status int, header http.Header) *http.Response {
recorder := httptest.NewRecorder()
for key, values := range header {
recorder.Header()[key] = values
}
maps.Copy(recorder.Header(), header)
recorder.WriteHeader(status)
return recorder.Result()
}
Expand Down