Open
Conversation
Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>
Contributor
There was a problem hiding this comment.
Pull request overview
Implements the remaining follow_redirect boolean from the test schema to allow stages to follow redirects emitted by prior stages.
Changes:
- Track the previous stage’s HTTP response in
TestRunContextand reset it at the start of each test case. - Add redirect parsing/application utilities and wire them into
RunStagewhenfollow_redirectis enabled. - Add unit tests for redirect parsing and input mutation behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| runner/types.go | Adds LastStageResponse to carry prior-stage response state for redirect handling. |
| runner/run.go | Resets/stores LastStageResponse per test/stage and applies follow_redirect logic before sending requests. |
| runner/redirect.go | Implements redirect Location parsing and applies redirect target to the next stage’s request input. |
| runner/redirect_test.go | Adds unit tests for redirect parsing and applying redirects to inputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
@copilot open a new pull request to apply changes based on the comments in this thread |
Contributor
) * Initial plan * fix: address PR review comments for follow_redirect - Restrict redirect status codes to 300-303, 307-308 (not all 3xx) - Use url.Parse + ResolveReference for proper URL handling - Include port in Host header for non-default ports - Fix comment about fragments in RequestURI - Store and use previous stage input for relative redirects - Move overriddenTestResult check before follow_redirect - Add zerolog.Disabled to redirect_test.go SetupSuite Co-authored-by: fzipi <3012076+fzipi@users.noreply.github.com> * test: add integration test for follow_redirect Add integration test that validates: - Stage 1 sends request to /redirect-me - Stage 1 receives 302 redirect to /redirected - Stage 2 uses follow_redirect to follow the redirect - Stage 2 sends request to /redirected - Both stages complete successfully Co-authored-by: fzipi <3012076+fzipi@users.noreply.github.com> * test: improve test coverage for follow_redirect - Add test for non-redirect 3xx codes (304, 305, 306) - Remove redundant port != 0 check in applyRedirectToInput - Enhance integration test to validate Host header includes port - Verify Host header is correctly updated after redirect Co-authored-by: fzipi <3012076+fzipi@users.noreply.github.com> * fix: address PR review feedback for follow_redirect implementation Co-authored-by: fzipi <3012076+fzipi@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: fzipi <3012076+fzipi@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what
follow_redirectboolean from schemawhy
refs