Skip to content

Commit 35e0f3c

Browse files
committed
Refine the redirect check condition
1 parent 2c7f7a6 commit 35e0f3c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/transports/http.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,12 @@ static int on_headers_complete(http_parser *parser)
295295
}
296296
}
297297

298-
/* Check for a 302 Found (redirect).
298+
/* Check for a redirect.
299299
* Right now we only permit a redirect to the same hostname. */
300-
if (parser->status_code == 302 &&
300+
if ((parser->status_code == 301 ||
301+
parser->status_code == 302 ||
302+
(parser->status_code == 303 && get_verb == s->verb) ||
303+
parser->status_code == 307) &&
301304
t->location) {
302305

303306
if (s->redirect_count >= 7) {

0 commit comments

Comments
 (0)