Skip to content

Commit

Permalink
fix: remove check_origin and cors_plug
Browse files Browse the repository at this point in the history
Signed-off-by: shiipou <shiishii@nocturlab.fr>
  • Loading branch information
shiipou committed Mar 8, 2022
1 parent 4a38d85 commit a4867b9
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 13 deletions.
1 change: 0 additions & 1 deletion apps/lenra_web/lib/lenra_web/endpoint.ex
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,5 @@ defmodule LenraWeb.Endpoint do
plug Plug.MethodOverride
plug Plug.Head
plug Plug.Session, @session_options
plug CORSPlug
plug LenraWeb.Router
end
1 change: 0 additions & 1 deletion apps/lenra_web/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ defmodule LenraWeb.MixProject do
{:telemetry_poller, "~> 0.4"},
{:plug_cowboy, "~> 2.0"},
{:phoenix_ecto, "~> 4.1"},
{:cors_plug, "~> 2.0"},
{:sentry, "~> 8.0"},
{:peerage, "~> 1.0"},
{:lenra, in_umbrella: true},
Expand Down
3 changes: 2 additions & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ config :lenra_web, LenraWeb.Endpoint,
url: [host: "localhost"],
http: [port: {:system, "PORT"}],
render_errors: [view: LenraWeb.ErrorView, accepts: ~w(json), layout: false],
pubsub_server: Lenra.PubSub
pubsub_server: Lenra.PubSub,
check_origin: false

config :lenra_web,
app_url_prefix: "https://#{System.get_env("APP_HOST", "localhost:#{System.get_env("CLIENT_PORT", "10000")}")}/app"
Expand Down
5 changes: 0 additions & 5 deletions config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,8 @@ config :lenra_web, LenraWeb.Endpoint,
secret_key_base: "FuEn07fjnCLaC53BiDoBagPYdsv/S65QTfxWgusKP1BA5NiaFzXGYMHLZ6JAYxt1",
debug_errors: false,
code_reloader: true,
check_origin: false,
watchers: []

config :cors_plug,
origin: System.get_env("ALLOWED_CLIENT_ORIGINS", "http://localhost:10000") |> String.split(","),
methods: ["GET", "POST", "PUT", "PATCH", "OPTION"]

# ## SSL Support
#
# In order to use HTTPS in development, a self-signed
Expand Down
5 changes: 0 additions & 5 deletions config/prod.exs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,3 @@ config :lenra_web, LenraWeb.Endpoint,

config :lenra,
faas_secrets: ["gitlab-registry"]

# Edit to allow only wanted sources
config :cors_plug,
origin: System.fetch_env!("ALLOWED_CLIENT_ORIGINS") |> String.split(","),
methods: ["GET", "POST", "PUT", "PATCH", "OPTION"]

0 comments on commit a4867b9

Please sign in to comment.