]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Also authenticate web IF.
authorMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 2 Dec 2019 21:47:22 +0000 (16:47 -0500)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 2 Dec 2019 21:47:22 +0000 (16:47 -0500)
tools/ippeveprinter.c

index 930331e0fe9d05111ca08a3e8d74a3851f9d65a5..a1c08790e125e91155a383ba641792ba859031bc 100644 (file)
@@ -5734,8 +5734,7 @@ process_http(ippeve_client_t *client)     /* I - Client connection */
   * Handle HTTP Upgrade...
   */
 
   * Handle HTTP Upgrade...
   */
 
-  if (!strcasecmp(httpGetField(client->http, HTTP_FIELD_CONNECTION),
-                        "Upgrade"))
+  if (!strcasecmp(httpGetField(client->http, HTTP_FIELD_CONNECTION), "Upgrade"))
   {
 #ifdef HAVE_SSL
     if (strstr(httpGetField(client->http, HTTP_FIELD_UPGRADE), "TLS/") != NULL && !httpIsEncrypted(client->http))
   {
 #ifdef HAVE_SSL
     if (strstr(httpGetField(client->http, HTTP_FIELD_UPGRADE), "TLS/") != NULL && !httpIsEncrypted(client->http))
@@ -5854,32 +5853,44 @@ process_http(ippeve_client_t *client)   /* I - Client connection */
            httpFlushWrite(client->http);
          }
        }
            httpFlushWrite(client->http);
          }
        }
-       else if (!strcmp(client->uri, "/"))
+       else
        {
         /*
        {
         /*
-         * Show web status page...
+         * Authenticate if needed...
          */
 
          */
 
-          return (show_status(client));
-       }
-       else if (!strcmp(client->uri, "/media"))
-       {
-        /*
-         * Show web media page...
-         */
+         if ((http_status = authenticate_request(client)) != HTTP_STATUS_CONTINUE)
+         {
+           return (respond_http(client, http_status, NULL, NULL, 0));
+         }
 
 
-          return (show_media(client));
-       }
-       else if (!strcmp(client->uri, "/supplies"))
-       {
-        /*
-         * Show web supplies page...
-         */
+         if (!strcmp(client->uri, "/"))
+         {
+          /*
+           * Show web status page...
+           */
+
+           return (show_status(client));
+         }
+         else if (!strcmp(client->uri, "/media"))
+         {
+          /*
+           * Show web media page...
+           */
 
 
-          return (show_supplies(client));
+           return (show_media(client));
+         }
+         else if (!strcmp(client->uri, "/supplies"))
+         {
+          /*
+           * Show web supplies page...
+           */
+
+           return (show_supplies(client));
+         }
+         else
+           return (respond_http(client, HTTP_STATUS_NOT_FOUND, NULL, NULL, 0));
        }
        }
-       else
-         return (respond_http(client, HTTP_STATUS_NOT_FOUND, NULL, NULL, 0));
        break;
 
     case HTTP_STATE_POST :
        break;
 
     case HTTP_STATE_POST :