Skip to content

Redirection location method not GET #4397

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

Open
2 of 4 tasks
ElRige opened this issue Apr 1, 2025 · 4 comments · May be fixed by #4561
Open
2 of 4 tasks

Redirection location method not GET #4397

ElRige opened this issue Apr 1, 2025 · 4 comments · May be fixed by #4561
Assignees
Labels
bug Something isn't working

Comments

@ElRige
Copy link

ElRige commented Apr 1, 2025

I have checked the following:

  • I have searched existing issues and found nothing related to my issue.

This bug is:

  • making Bruno unusable for me
  • slowing me down but I'm able to continue working
  • annoying

Bruno version

2.0.1, 2.1.0

Operating System

macOS 15.3.2

Describe the bug

With a request like POST /resources
If the response is HTTP 303 with header location "/resources/1234"
Bruno try to call POST "/resources/1234" and failed because there is no such path
Bruno should call GET "/resources/1234"

.bru file to reproduce the bug

No response

Screenshots/Live demo link

failed with redirect :
Image

303 when no redirect :
Image

@ElRige ElRige added the bug Something isn't working label Apr 1, 2025
@sreelakshmi-bruno sreelakshmi-bruno self-assigned this Apr 2, 2025
@mlataza
Copy link

mlataza commented Apr 24, 2025

I'm having the same issue.

@anusree-bruno
Copy link
Collaborator

Hey! Thanks for reporting this issue. I've looked into how HTTP redirects should work, and here's what I found:

  1. What's happening now in Bruno:
  • Bruno keeps the original method (like POST) for all redirects
  • This causes problems with 301, 302, and 303 redirects
  1. What the HTTP spec says:
  • 301/302: Can change POST to GET (but doesn't have to)
  • 303: Should use GET or HEAD
  • 307/308: Must keep the original method
  1. How it should work:
Status Code What happens Body handling
301 - HEAD stays as HEAD
- Everything else becomes GET
TBD
302 - HEAD stays as HEAD
- Everything else becomes GET
TBD
303 - HEAD stays as HEAD
- Everything else becomes GET
TBD
307 Keep whatever method was used Keep the body
308 Keep whatever method was used Keep the body
  1. Things we need to decide:
  • Should we keep or remove the request body when changing to GET?
  • Should we add an option to let users choose whether to keep the original method?

You can check out the full spec here: https://datatracker.ietf.org/doc/html/rfc7231#section-6.4

@anusree-bruno anusree-bruno self-assigned this Apr 24, 2025
@ElRige
Copy link
Author

ElRige commented Apr 24, 2025

I didn't make it clear in my first post, in previous versions of Bruno (1.x.x and 2.0.0), the redirection worked fine.
So version 2.0.1 has created a regression

@anusree-bruno
Copy link
Collaborator

@ElRige
Earlier axios was handling the redirects we had changed it here #4324. I think axios was handling these scenarios.

@naman-bruno naman-bruno linked a pull request Apr 25, 2025 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants