Repository navigation
Save cookies on redirect response - #6094
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where set-cookie headers in redirect responses (e.g., 302) were not being processed. The fix adds cookie saving logic to the error response handler, since Axios treats redirects with maxRedirects: 0 as errors.
Key Changes
- Added cookie saving logic in the error response handler to capture cookies from redirect responses
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a976753 to
c9d2c0f
Compare
sanish-bruno
left a comment
There was a problem hiding this comment.
LGTM. we may need to fix the linting errors
c9d2c0f to
18960de
Compare
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughTwo files updated to persist cookies from error responses in CLI and Electron IPC network handlers, extending the existing success-path cookie-saving logic to error paths when cookie storage is enabled. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related issues
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (1)**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (CODING_STANDARDS.md)
Files:
🧬 Code graph analysis (2)packages/bruno-cli/src/runner/run-single-request.js (3)
packages/bruno-electron/src/ipc/network/index.js (3)
🔇 Additional comments (2)
Comment |
|
This is a related PR #5387 , It is done for both cli as well as electron. and it is handled at the axios level. But, we will have to check, why we needed this changes in the first place cc: @Pragadesh44-Bruno @pooja-bruno @bijin-bruno |
|
@sanish-bruno, I checked and this doesn’t seem to be related to the PR you attached. This issue is different, and the fix looks fine to me. |
|
@JeroenVinke I have few doubts,
|
|
@sanish-bruno good points, should I revert the change until we have had time to investigate further? |
This reverts commit 1b9ea47.
|
I’m reverting this PR via #6413, as the issue appears to have already been addressed in #5387, and due to time constraints for the v3.0.0 release. We can revisit this and investigate further if the issue still exists, and address it in a future version. @JeroenVinke Thanks for your understanding, and we really appreciate the time and effort you put into this contribution. |
|
So in wich version of Bruno did you guys resolve this bug ? Because im' actually running 2.15.1 ans the bug is still present. Thnaks |
Co-authored-by: Jeroen Vinke <[email protected]>
Description
When the response is a redirect (e.g. 302) the set-cookie headers were not processed.
This problem happened in the collection runner and the CLI.
Let me know if the change is too naive
Are there any automated tests I can add?
Fixes #5658
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.