Skip to content

Commit 6dc30fb

Browse files
committed
chore: slight debugging of previous
1 parent 228a051 commit 6dc30fb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ func newCachingProxy(next string, cacheTime time.Duration) (http.Handler, error)
108108
type githubRedirector struct {
109109
releasesURL string
110110
refreshInterval time.Duration
111+
next http.Handler
111112

112113
mut sync.Mutex
113114
assets map[string]string
114-
next http.Handler
115115
}
116116

117117
func (r *githubRedirector) Serve(ctx context.Context) error {
@@ -124,6 +124,7 @@ func (r *githubRedirector) Serve(ctx context.Context) error {
124124
if err != nil {
125125
return err
126126
}
127+
slog.Info("loaded GitHub assets", "count", len(assets))
127128
r.mut.Lock()
128129
r.assets = assets
129130
r.mut.Unlock()
@@ -140,9 +141,12 @@ func (r *githubRedirector) ServeHTTP(w http.ResponseWriter, req *http.Request) {
140141
url, ok := r.assets[file]
141142
r.mut.Unlock()
142143
if ok {
144+
slog.Info("serving redirect", "from", req.URL, "to", url)
143145
http.Redirect(w, req, url, http.StatusTemporaryRedirect)
144146
return
145147
}
148+
149+
slog.Info("serving direct", "url", req.URL)
146150
r.next.ServeHTTP(w, req)
147151
}
148152

0 commit comments

Comments
 (0)