r19139: typos; consitent ordering of operations
authorDerrell Lipman <derrell@samba.org>
Fri, 6 Oct 2006 15:37:39 +0000 (15:37 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:20:38 +0000 (14:20 -0500)
(This used to be commit aaab47cb910fbbec6913bc5f796f0d6d479f729d)

source4/web_server/http.c

index 43da3c94168725b195d47d8686eaaf4a6c948b2b..f9867a152a4bc94d4038d9766ea6342cc5870377 100644 (file)
@@ -548,11 +548,13 @@ static void jsonrpc_request(struct esp_state *esp)
 }
 
 /*
-  perform pre-authentication on every page is /scripting/preauth.esp
+  perform pre-authentication on every page if /scripting/preauth.esp
   exists.  If this script generates any non-whitepace output at all,
   then we don't run the requested URL.
 
-  note that the preauth is run even for static pages such as images.
+  note that the preauth is run even for static pages such as images, but not
+  for JSON-RPC service requests which do their own authentication via the
+  JSON-RPC server.
 */
 static BOOL http_preauth(struct esp_state *esp)
 {
@@ -900,13 +902,13 @@ void http_process_input(struct websrv_context *web)
             }
             for (i=0;p && i<ARRAY_SIZE(mime_types);i++) {
                if (strcmp(mime_types[i].extension, p+1) == 0) {
-                    file_type = mime_types[i].mime_type;
                     page_type = mime_types[i].page_type;
+                    file_type = mime_types[i].mime_type;
                }
             }
             if (file_type == NULL) {
-               file_type = "text/html";
                 page_type = page_type_simple;
+               file_type = "text/html";
             }
         }