Skip to content

[bug] 在开启“自动跟随重定向”的情况下,当向服务器发送 POST 请求且服务器返回 307 Temporary Redirect 进行跨域名跳转时,Reqable 会错误地将请求方法降级为 GET 并丢弃请求体(Body),导致请求最终失败并收到后端的 405 Method Not Allowed 错误。 #2647

@otaku-say

Description

@otaku-say

Describe the bug
在开启“自动跟随重定向”的情况下,当向服务器发送 POST 请求且服务器返回 307 Temporary Redirect 进行跨域名跳转时,Reqable 会错误地将请求方法降级为 GET 并丢弃请求体(Body),导致请求最终失败并收到后端的 405 Method Not Allowed 错误。

根据 HTTP 307 规范,客户端在跟随重定向时必须严格保持原有的请求方法(POST)和请求体(Body)不变。目前 Reqable 的处理逻辑在跨域名重定向时存在方法篡改(Method Swapping)的问题。

To Reproduce
Steps to reproduce the behavior:

在 Reqable 中创建一个新的 POST 请求,并在请求设置中开启 “跟随重定向 (Follow Redirects)”。

输入一个会触发跨域名 307 重定向的 API 地址(例如从自定义域名重定向到 *.amazonaws.com 的 Lambda 终点)。

携带正常的 JSON 请求体发送请求。

观察响应结果:收到了目标后端返回的 {"detail": "Method Not Allowed"} (405)。

验证:若在设置中关闭“跟随重定向”,Reqable 能正常停在第一步并接收到服务器返回的 307 状态码。

Expected behavior
在自动跟随 307 重定向时,Reqable 应当遵循 HTTP 协议规范,保持原有的 POST 方法和 Body 数据不变,用 POST 访问重定向后的新地址。

Information
Platform: macos

OS: 26.5.1 (25F80)

Arch: arm64 (M4)

App Version: 3.1.3 (197)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingp0Priority processing

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions