mirror of
https://gitee.com/dromara/hutool.git
synced 2026-02-09 09:16:26 +08:00
修复HttpRequest.sendRedirectIfPossible未对308做判断问题。(issue#4053@Github)
This commit is contained in:
@@ -1335,8 +1335,8 @@ public class HttpRequest extends HttpBase<HttpRequest> {
|
||||
setUrl(redirectUrl);
|
||||
// https://www.rfc-editor.org/rfc/rfc7231#section-6.4.7
|
||||
// https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Redirections
|
||||
// 307方法和消息主体都不发生变化。
|
||||
if (HttpStatus.HTTP_TEMP_REDIRECT != responseCode) {
|
||||
// 307、308方法和消息主体都不发生变化。
|
||||
if (HttpStatus.HTTP_TEMP_REDIRECT != responseCode && HttpStatus.HTTP_PERMANENT_REDIRECT != responseCode) {
|
||||
// 重定向默认使用GET
|
||||
method(Method.GET);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user