From: Christian Dywan Date: Sun, 3 May 2009 23:09:52 +0000 (+0200) Subject: Reject non-local requests to the res_server X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5eba36cf41a73238d2721e7f86ca0c0a4791ba4;p=midori Reject non-local requests to the res_server This sever is solely meant to provide internal resources and should not be accessible from outside, so anything non-local is blocked with a No Content error. --- diff --git a/midori/sokoke.c b/midori/sokoke.c index c144aa79..4af14af6 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -980,6 +980,12 @@ res_server_handler_cb (SoupServer* res_server, SoupClientContext* client, gpointer data) { + if (g_strcmp0 (soup_message_get_uri (msg)->host, "localhost")) + { + soup_message_set_status (msg, 204); + return; + } + if (g_str_has_prefix (path, "/res")) { gchar* filename = g_strconcat (DATADIR "/midori", path, NULL); @@ -995,7 +1001,7 @@ res_server_handler_cb (SoupServer* res_server, soup_message_set_response (msg, mime_type, SOUP_MEMORY_TAKE, contents, length); g_free (mime_type); - soup_message_set_status (msg, 401); + soup_message_set_status (msg, 200); } else soup_message_set_status (msg, 404);