-
-
Notifications
You must be signed in to change notification settings - Fork 2
Handle HTTP redirection responses in Client.php #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…L support; add tests for response behavior
There was a problem hiding this 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 adds HTTP redirect handling capabilities to the FeedIo HTTP client with support for all standard redirect status codes (301, 302, 303, 307, 308), including protection against infinite redirect loops and relative URL resolution.
- Implements automatic following of HTTP redirects with configurable maximum limit (10 redirects)
- Adds support for both absolute and relative redirect URLs
- Preserves If-Modified-Since headers through redirect chains
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| src/FeedIo/Adapter/Http/Client.php | Adds redirect handling logic with MAX_REDIRECTS constant, handleRedirect method for processing redirect responses, and resolveRedirectUrl method for converting relative URLs to absolute |
| tests/FeedIo/Adapter/Http/ClientTest.php | Comprehensive test suite covering redirect scenarios including multiple redirects, different status codes, empty Location headers, and duration tracking |
| CHANGELOG.md | Documents the new HTTP redirect handling feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
… reject malicious redirect schemes
…n relative and absolute paths
No description provided.