Skip to content

Conversation

@wofferl
Copy link
Collaborator

@wofferl wofferl commented Jan 30, 2026

Summary

This PR is a follow up to #3528 that fixes the real problem that the different http clients uses wrong user agents and don't respect the proxy confguration.
That is why the client requests can stuck (propably blocked by CDN).

Therefore, the configuration is now standardised via getHttpClient in the FetcherConfig.
Different timeout values or optional parameters can be set via $config parameter.

Checklist

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses proxy configuration and user agent issues in HTTP clients across the News app by centralizing HTTP client configuration. This is a follow-up to PR #3528 that resolves the root cause of requests getting stuck due to improper HTTP client configuration.

Changes:

  • Introduces a new getHttpClient() method in FetcherConfig to centralize Guzzle client configuration with consistent user agent, timeout, and proxy settings
  • Updates the existing getClient() method to use the new centralized configuration
  • Migrates hasLastModifiedHeader() and downloadFavicon() in FeedFetcher to use the centralized client factory
  • Adds proxy configuration support to the Scraper's cURL implementation

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
lib/Config/FetcherConfig.php Added getHttpClient() method to centralize Guzzle client configuration and refactored getClient() to use it; added CONNECT_TIMEOUT constant
lib/Fetcher/FeedFetcher.php Replaced direct Client instantiations with calls to getHttpClient(); removed redundant User-Agent header from downloadFavicon request options; removed unused import
lib/Scraper/Scraper.php Added proxy configuration support by checking and applying proxy settings from FetcherConfig
CHANGELOG.md Documented the fix for proxy configuration issues in feed logo download and fulltext scraper

@wofferl wofferl force-pushed the fix_http_client_headers branch from 46cdfac to 03b9b3d Compare January 30, 2026 18:22
@wofferl wofferl merged commit 9428668 into nextcloud:master Jan 31, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review API Impact API/Backend code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants