mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-18 10:35:55 +00:00
Implement HTTP 305 redirect handling.
PR: 172452 Submitted by: gcooper Reviewed by: des Approved by: cperciva MFC after: 1 week
This commit is contained in:
parent
c4fa1489ec
commit
8d049fb235
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=241841
@ -103,6 +103,7 @@ __FBSDID("$FreeBSD$");
|
||||
#define HTTP_MOVED_TEMP 302
|
||||
#define HTTP_SEE_OTHER 303
|
||||
#define HTTP_NOT_MODIFIED 304
|
||||
#define HTTP_USE_PROXY 305
|
||||
#define HTTP_TEMP_REDIRECT 307
|
||||
#define HTTP_PERM_REDIRECT 308
|
||||
#define HTTP_NEED_AUTH 401
|
||||
@ -113,6 +114,7 @@ __FBSDID("$FreeBSD$");
|
||||
#define HTTP_REDIRECT(xyz) ((xyz) == HTTP_MOVED_PERM \
|
||||
|| (xyz) == HTTP_MOVED_TEMP \
|
||||
|| (xyz) == HTTP_TEMP_REDIRECT \
|
||||
|| (xyz) == HTTP_USE_PROXY \
|
||||
|| (xyz) == HTTP_SEE_OTHER)
|
||||
|
||||
#define HTTP_ERROR(xyz) ((xyz) > 400 && (xyz) < 599)
|
||||
@ -1697,6 +1699,7 @@ http_request(struct url *URL, const char *op, struct url_stat *us,
|
||||
case HTTP_MOVED_PERM:
|
||||
case HTTP_MOVED_TEMP:
|
||||
case HTTP_SEE_OTHER:
|
||||
case HTTP_USE_PROXY:
|
||||
/*
|
||||
* Not so fine, but we still have to read the
|
||||
* headers to get the new location.
|
||||
@ -1778,7 +1781,8 @@ http_request(struct url *URL, const char *op, struct url_stat *us,
|
||||
*/
|
||||
if (noredirect &&
|
||||
conn->err != HTTP_MOVED_PERM &&
|
||||
conn->err != HTTP_PERM_REDIRECT) {
|
||||
conn->err != HTTP_PERM_REDIRECT &&
|
||||
conn->err != HTTP_USE_PROXY) {
|
||||
n = 1;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user