Skip to content

Use browser-like order of http headers to avoid triggering bot detections#3552

Merged
Grotax merged 2 commits intonextcloud:masterfrom
wofferl:fix_http_header_order
Feb 9, 2026
Merged

Use browser-like order of http headers to avoid triggering bot detections#3552
Grotax merged 2 commits intonextcloud:masterfrom
wofferl:fix_http_header_order

Conversation

@wofferl
Copy link
Collaborator

@wofferl wofferl commented Feb 8, 2026

Summary

It seems that the fix #3533 now triggers bot detections like on reddit.com which now gets again "403 denied".

This PR makes sure that the headers are browser-like and, as before, with the User-Agent before other headers.
It also fixes the max redirect option which changed with guzzle 7.

Checklist

…parameter for guzzle

Signed-off-by: Wolfgang <github@linux-dude.de>
@wofferl wofferl added 3. to review API Impact API/Backend code Skip-Changelog No changelog update is required, minor change labels Feb 8, 2026
@Grotax Grotax requested a review from Copilot February 8, 2026 19:22
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

Adjusts the backend HTTP client configuration (Guzzle) used by the News app’s fetchers to better mimic browser request header ordering (notably ensuring User-Agent precedes other headers) and to correctly apply the max-redirect limit after the Guzzle 7 option change—aiming to reduce 403/bot-detection blocks (e.g., Reddit).

Changes:

  • Introduce a defaultConfig and merge it with the provided $config to control header insertion order and provide consistent defaults.
  • Ensure User-Agent is present by default and merged ahead of other headers.
  • Switch redirect limiting from the legacy redirect.max key to Guzzle 7’s allow_redirects['max'].

Signed-off-by: Wolfgang <github@linux-dude.de>
@Grotax Grotax merged commit 4ae50e9 into nextcloud:master Feb 9, 2026
27 of 28 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 Skip-Changelog No changelog update is required, minor change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments