Commit bfdcd72d authored by Benjamin Kaufmann's avatar Benjamin Kaufmann Committed by Patrick Griffis

soup-session: Add support for status code 308 Permanent Redirect

parent 830054ed
Pipeline #197690 passed with stage
in 1 minute and 16 seconds
......@@ -1076,6 +1076,7 @@ auth_manager_authenticate (SoupAuthManager *manager, SoupMessage *msg,
#define SOUP_SESSION_WOULD_REDIRECT_AS_SAFE(session, msg) \
(((msg)->status_code == SOUP_STATUS_MOVED_PERMANENTLY || \
(msg)->status_code == SOUP_STATUS_PERMANENT_REDIRECT || \
(msg)->status_code == SOUP_STATUS_TEMPORARY_REDIRECT || \
(msg)->status_code == SOUP_STATUS_FOUND) && \
SOUP_METHOD_IS_SAFE ((msg)->method))
......
......@@ -58,6 +58,7 @@ typedef enum {
SOUP_STATUS_USE_PROXY = 305,
SOUP_STATUS_NOT_APPEARING_IN_THIS_PROTOCOL = 306, /* (reserved) */
SOUP_STATUS_TEMPORARY_REDIRECT = 307,
SOUP_STATUS_PERMANENT_REDIRECT = 308,
SOUP_STATUS_BAD_REQUEST = 400,
SOUP_STATUS_UNAUTHORIZED = 401,
......
......@@ -37,6 +37,9 @@ static TestCase tests[] = {
{ { { "GET", "/307", 307 },
{ "GET", "/", 200 },
{ NULL } }, 200, NULL },
{ { { "GET", "/308", 308 },
{ "GET", "/", 200 },
{ NULL } }, 200, NULL },
{ { { "HEAD", "/301", 301 },
{ "HEAD", "/", 200 },
{ NULL } }, 200, "551190" },
......@@ -52,6 +55,9 @@ static TestCase tests[] = {
{ { { "HEAD", "/307", 307 },
{ "HEAD", "/", 200 },
{ NULL } }, 200, "551190" },
{ { { "HEAD", "/308", 308 },
{ "HEAD", "/", 200 },
{ NULL } }, 200, "551190" },
/* A non-redirecty response to a GET or HEAD should not */
......@@ -63,8 +69,6 @@ static TestCase tests[] = {
{ NULL } }, 305, NULL },
{ { { "GET", "/306", 306 },
{ NULL } }, 306, NULL },
{ { { "GET", "/308", 308 },
{ NULL } }, 308, NULL },
{ { { "HEAD", "/300", 300 },
{ NULL } }, 300, "551190" },
{ { { "HEAD", "/304", 304 },
......@@ -73,8 +77,6 @@ static TestCase tests[] = {
{ NULL } }, 305, "551190" },
{ { { "HEAD", "/306", 306 },
{ NULL } }, 306, "551190" },
{ { { "HEAD", "/308", 308 },
{ NULL } }, 308, "551190" },
/* Test double-redirect */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment