Return 204 response on options request
authorDominique Feyer <dfeyer@ttree.ch>
Mon, 17 Sep 2018 10:21:01 +0000 (12:21 +0200)
committerDominique Feyer <dfeyer@ttree.ch>
Mon, 17 Sep 2018 10:21:01 +0000 (12:21 +0200)
lib/pleroma/web/router.ex

index 856679899db413f880b7ff5df29b7f660feed5e6..43e301034fa54255c4ba5191d26a286cd7ddf139 100644 (file)
@@ -400,6 +400,8 @@ defmodule Pleroma.Web.Router do
   scope "/", Fallback do
     get("/registration/:token", RedirectController, :registration_page)
     get("/*path", RedirectController, :redirector)
+
+    options("/*path", RedirectController, :empty)
   end
 end
 
@@ -417,4 +419,10 @@ defmodule Fallback.RedirectController do
   def registration_page(conn, params) do
     redirector(conn, params)
   end
+
+  def empty(conn, _params) do
+    conn
+    |> put_status(204)
+    |> text("")
+  end
 end