Skip to content

docs(redirects): clarify headers argument on redirect exceptions#2677

Open
chucknuris wants to merge 3 commits into
falconry:masterfrom
chucknuris:docs/clarify-redirect-headers
Open

docs(redirects): clarify headers argument on redirect exceptions#2677
chucknuris wants to merge 3 commits into
falconry:masterfrom
chucknuris:docs/clarify-redirect-headers

Conversation

@chucknuris

Copy link
Copy Markdown

Summary

The redirect exceptions (HTTPMovedPermanently, HTTPFound, HTTPSeeOther, HTTPTemporaryRedirect, HTTPPermanentRedirect) accept a headers argument, but it was undocumented. As raised in #1920, this left it ambiguous whether those headers merge with the incoming request headers or the response headers.

This PR documents the headers argument on all five redirect classes, clarifying that the headers are merged into those already set on the response, and are unrelated to the headers of the incoming request.

Changes

  • Added a headers entry to the Args: docstring of each redirect exception in falcon/redirects.py.
  • Added a misc news fragment (docs/_newsfragments/1920.misc.rst).

Verification

  • ruff format --check and ruff check pass (docstring-only change; no formatting impact).
  • towncrier build --draft renders the changelog entry correctly.

Closes #1920

chucknuris and others added 2 commits July 5, 2026 16:23
The redirect exceptions accept a headers argument, but its behavior was
not documented, leading to confusion over whether these headers merge
with the incoming request headers or the response headers.

Document the headers argument on HTTPMovedPermanently, HTTPFound,
HTTPSeeOther, HTTPTemporaryRedirect, and HTTPPermanentRedirect, clarifying
that the headers are merged into those already set on the response and are
unrelated to the request headers.

Closes falconry#1920
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (6a49881) to head (ff42b86).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2677   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           64        64           
  Lines         7985      7985           
  Branches      1103      1103           
=========================================
  Hits          7985      7985           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify response header behavior in the case of a redirect

2 participants