From: msweet Date: Wed, 24 Jun 2015 18:22:32 +0000 (+0000) Subject: Fix redirection in the web interface (STR #4538) X-Git-Tag: v2.2b1~249 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7c0e8801374e8d6c6fa83b4ed36ac1d2efafc12;p=thirdparty%2Fcups.git Fix redirection in the web interface (STR #4538) git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12751 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES-2.0.txt b/CHANGES-2.0.txt index 464523702c..680c107799 100644 --- a/CHANGES-2.0.txt +++ b/CHANGES-2.0.txt @@ -4,6 +4,7 @@ CHANGES-2.0.txt CHANGES IN CUPS V2.0.4 - Fixed a bug in cupsRasterWritePixels (STR #4650) + - Fixed redirection in the web interface (STR #4538) CHANGES IN CUPS V2.0.3 diff --git a/scheduler/client.c b/scheduler/client.c index 6721445415..1221d2c8e9 100644 --- a/scheduler/client.c +++ b/scheduler/client.c @@ -2159,6 +2159,9 @@ cupsdSendError(cupsd_client_t *con, /* I - Connection */ http_status_t code, /* I - Error code */ int auth_type)/* I - Authentication type */ { + char location[HTTP_MAX_VALUE]; /* Location field */ + + cupsdLogClient(con, CUPSD_LOG_DEBUG2, "cupsdSendError code=%d, auth_type=%d", code, auth_type); @@ -2191,8 +2194,12 @@ cupsdSendError(cupsd_client_t *con, /* I - Connection */ * never disable it in that case. */ + strlcpy(location, httpGetField(con->http, HTTP_FIELD_LOCATION), sizeof(location)); + httpClearFields(con->http); + httpSetField(con->http, HTTP_FIELD_LOCATION, location); + if (code >= HTTP_STATUS_BAD_REQUEST && con->type != CUPSD_AUTH_NEGOTIATE) httpSetKeepAlive(con->http, HTTP_KEEPALIVE_OFF);