gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r35991 - libmicrohttpd/src/examples


From: gnunet
Subject: [GNUnet-SVN] r35991 - libmicrohttpd/src/examples
Date: Thu, 25 Jun 2015 21:08:49 +0200

Author: grothoff
Date: 2015-06-25 21:08:49 +0200 (Thu, 25 Jun 2015)
New Revision: 35991

Modified:
   libmicrohttpd/src/examples/demo.c
Log:
modify demo to handle HEAD requests

Modified: libmicrohttpd/src/examples/demo.c
===================================================================
--- libmicrohttpd/src/examples/demo.c   2015-06-25 12:59:09 UTC (rev 35990)
+++ libmicrohttpd/src/examples/demo.c   2015-06-25 19:08:49 UTC (rev 35991)
@@ -690,8 +690,9 @@
       ssize_t got;
       const char *mime;
 
-      if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
-       return MHD_NO;  /* unexpected method (we're not polite...) */
+      if ( (0 != strcmp (method, MHD_HTTP_METHOD_GET)) &&
+           (0 != strcmp (method, MHD_HTTP_METHOD_HEAD)) )
+        return MHD_NO;  /* unexpected method (we're not polite...) */
       if ( (0 == stat (&url[1], &buf)) &&
           (NULL == strstr (&url[1], "..")) &&
           ('/' != url[1]))
@@ -783,7 +784,8 @@
          return return_directory_response (connection);
        }
     }
-  if (0 == strcmp (method, MHD_HTTP_METHOD_GET))
+  if ( (0 == strcmp (method, MHD_HTTP_METHOD_GET)) ||
+       (0 == strcmp (method, MHD_HTTP_METHOD_HEAD)) )
   {
     return return_directory_response (connection);
   }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]