[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r33876 - gnunet/src/hostlist
From: |
gnunet |
Subject: |
[GNUnet-SVN] r33876 - gnunet/src/hostlist |
Date: |
Fri, 27 Jun 2014 01:49:06 +0200 |
Author: amatus
Date: 2014-06-27 01:49:06 +0200 (Fri, 27 Jun 2014)
New Revision: 33876
Modified:
gnunet/src/hostlist/gnunet-daemon-hostlist_server.c
Log:
Fix hostlist server CORS headers
Modified: gnunet/src/hostlist/gnunet-daemon-hostlist_server.c
===================================================================
--- gnunet/src/hostlist/gnunet-daemon-hostlist_server.c 2014-06-26 20:01:53 UTC
(rev 33875)
+++ gnunet/src/hostlist/gnunet-daemon-hostlist_server.c 2014-06-26 23:49:06 UTC
(rev 33876)
@@ -122,6 +122,27 @@
/**
+ * Add headers to a request indicating that we allow Cross-Origin Resource
+ * Sharing.
+ *
+ * @param response response to add headers to
+ */
+static void
+add_cors_headers (struct MHD_Response *response)
+{
+ MHD_add_response_header (response,
+ "Access-Control-Allow-Origin",
+ "*");
+ MHD_add_response_header (response,
+ "Access-Control-Allow-Methods",
+ "GET, OPTIONS");
+ MHD_add_response_header (response,
+ "Access-Control-Max-Age",
+ "86400");
+}
+
+
+/**
* Function that assembles our response.
*/
static void
@@ -135,6 +156,7 @@
response =
MHD_create_response_from_data (builder->size, builder->data, MHD_YES,
MHD_NO);
+ add_cors_headers (response);
if ((NULL == daemon_handle_v4) && (NULL == daemon_handle_v6))
{
MHD_destroy_response (response);
@@ -278,27 +300,6 @@
/**
- * Add headers to a request indicating that we allow Cross-Origin Resource
- * Sharing.
- *
- * @param response response to add headers to
- */
-static void
-add_cors_headers (struct MHD_Response *response)
-{
- MHD_add_response_header (response,
- "Access-Control-Allow-Origin",
- "*");
- MHD_add_response_header (response,
- "Access-Control-Allow-Methods",
- "GET, OPTIONS");
- MHD_add_response_header (response,
- "Access-Control-Max-Age",
- "86400");
-}
-
-
-/**
* Main request handler.
*
* @param cls argument given together with the function
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r33876 - gnunet/src/hostlist,
gnunet <=