fix: add jikan user-agent

This commit is contained in:
2026-05-26 22:24:45 +02:00
parent 7bff60f08a
commit 4ffa6af298

View File

@@ -16,6 +16,7 @@ import (
"mal/internal/config" "mal/internal/config"
"mal/internal/db" "mal/internal/db"
"mal/internal/observability" "mal/internal/observability"
"mal/pkg/net/useragent"
"golang.org/x/sync/singleflight" "golang.org/x/sync/singleflight"
) )
@@ -482,6 +483,7 @@ func (c *Client) fetchWithRetry(ctx context.Context, urlStr string, out any) err
if err != nil { if err != nil {
return logAndReturn(0, fmt.Errorf("failed to create jikan request: %w", err)) return logAndReturn(0, fmt.Errorf("failed to create jikan request: %w", err))
} }
req.Header.Set("User-Agent", useragent.Generic)
resp, err := c.httpClient.Do(req) resp, err := c.httpClient.Do(req)
if err != nil { if err != nil {