Przeglądaj źródła

fix(googlereader): apply configured user agent in quickadd handler

The /reader/api/0/subscription/quickadd endpoint was creating its
request builder without calling WithUserAgent, so outbound feed
fetches used Go's default user agent (Go-http-client/2.x) instead
of the operator-configured HTTP_CLIENT_USER_AGENT.

Sites like Reddit that block Go's default user agent would return
403, causing quickadd to fail even though adding the same feed via
the Miniflux web UI succeeded (the UI's subscription handler correctly
sets the configured user agent).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jiasen 1 tydzień temu
rodzic
commit
350df63d99
1 zmienionych plików z 1 dodań i 0 usunięć
  1. 1 0
      internal/googlereader/handler.go

+ 1 - 0
internal/googlereader/handler.go

@@ -345,6 +345,7 @@ func (h *greaderHandler) quickAddHandler(w http.ResponseWriter, r *http.Request)
 	requestBuilder := fetcher.NewRequestBuilder()
 	requestBuilder := fetcher.NewRequestBuilder()
 	requestBuilder.WithTimeout(config.Opts.HTTPClientTimeout())
 	requestBuilder.WithTimeout(config.Opts.HTTPClientTimeout())
 	requestBuilder.WithProxyRotator(proxyrotator.ProxyRotatorInstance)
 	requestBuilder.WithProxyRotator(proxyrotator.ProxyRotatorInstance)
+	requestBuilder.WithUserAgent("", config.Opts.HTTPClientUserAgent())
 
 
 	var rssBridgeURL string
 	var rssBridgeURL string
 	var rssBridgeToken string
 	var rssBridgeToken string