Add CORSPlug to make web-based OAuth easier.
authorlain <lain@soykaf.club>
Sat, 3 Nov 2018 12:38:01 +0000 (13:38 +0100)
committerlain <lain@soykaf.club>
Sat, 3 Nov 2018 12:38:01 +0000 (13:38 +0100)
lib/pleroma/web/endpoint.ex
mix.exs
mix.lock

index 955bd61f3b59af9c5953f64f182ba9bf15e06532..6673ab5768b5551d535f9d32d97a224f99bba9c4 100644 (file)
@@ -56,6 +56,7 @@ defmodule Pleroma.Web.Endpoint do
     extra: "SameSite=Strict"
   )
 
+  plug(CORSPlug)
   plug(Pleroma.Web.Router)
 
   @doc """
diff --git a/mix.exs b/mix.exs
index 885df0094a4f743fb1e1555089c52ed01f7814ef..427c5d8103b574555a8843f8dcc5f97ef943aced 100644 (file)
--- a/mix.exs
+++ b/mix.exs
@@ -53,7 +53,8 @@ defmodule Pleroma.Mixfile do
       {:credo, "~> 0.9.3", only: [:dev, :test]},
       {:mock, "~> 0.3.1", only: :test},
       {:crypt,
-       git: "https://github.com/msantos/crypt", ref: "1f2b58927ab57e72910191a7ebaeff984382a1d3"}
+       git: "https://github.com/msantos/crypt", ref: "1f2b58927ab57e72910191a7ebaeff984382a1d3"},
+      {:cors_plug, "~> 1.5"}
     ]
   end
 
index 105eaf6657f8032a8351a116c36db77cd85e31cf..13ccbd2514ae6f4b2e8eb5a0729811d58eaaaa7e 100644 (file)
--- a/mix.lock
+++ b/mix.lock
@@ -5,6 +5,7 @@
   "certifi": {:hex, :certifi, "2.3.1", "d0f424232390bf47d82da8478022301c561cf6445b5b5fb6a84d49a9e76d2639", [:rebar3], [{:parse_trans, "3.2.0", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm"},
   "comeonin": {:hex, :comeonin, "4.1.1", "c7304fc29b45b897b34142a91122bc72757bc0c295e9e824999d5179ffc08416", [:mix], [{:argon2_elixir, "~> 1.2", [hex: :argon2_elixir, repo: "hexpm", optional: true]}, {:bcrypt_elixir, "~> 0.12.1 or ~> 1.0", [hex: :bcrypt_elixir, repo: "hexpm", optional: true]}, {:pbkdf2_elixir, "~> 0.12", [hex: :pbkdf2_elixir, repo: "hexpm", optional: true]}], "hexpm"},
   "connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm"},
+  "cors_plug": {:hex, :cors_plug, "1.5.2", "72df63c87e4f94112f458ce9d25800900cc88608c1078f0e4faddf20933eda6e", [:mix], [{:plug, "~> 1.3 or ~> 1.4 or ~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"},
   "cowboy": {:hex, :cowboy, "1.1.2", "61ac29ea970389a88eca5a65601460162d370a70018afe6f949a29dca91f3bb0", [:rebar3], [{:cowlib, "~> 1.0.2", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.3.2", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm"},
   "cowlib": {:hex, :cowlib, "1.0.2", "9d769a1d062c9c3ac753096f868ca121e2730b9a377de23dec0f7e08b1df84ee", [:make], [], "hexpm"},
   "credo": {:hex, :credo, "0.9.3", "76fa3e9e497ab282e0cf64b98a624aa11da702854c52c82db1bf24e54ab7c97a", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:poison, ">= 0.0.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm"},