projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle bcrypt passwords for Mastodon migration
[akkoma]
/
lib
/
pleroma
/
plugs
/
instance_static.ex
diff --git
a/lib/pleroma/plugs/instance_static.ex
b/lib/pleroma/plugs/instance_static.ex
index 11f108de74f46ac8f20bfeca839d23476bc88fcd..7516f75c38bd747f37823a44b8bba4544aed102c 100644
(file)
--- a/
lib/pleroma/plugs/instance_static.ex
+++ b/
lib/pleroma/plugs/instance_static.ex
@@
-1,8
+1,10
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Plugs.InstanceStatic do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Plugs.InstanceStatic do
+ require Pleroma.Constants
+
@moduledoc """
This is a shim to call `Plug.Static` but with runtime `from` configuration.
@moduledoc """
This is a shim to call `Plug.Static` but with runtime `from` configuration.
@@
-21,8
+23,6
@@
defmodule Pleroma.Plugs.InstanceStatic do
end
end
end
end
- @only ~w(index.html static emoji packs sounds images instance favicon.png sw.js sw-pleroma.js)
-
def init(opts) do
opts
|> Keyword.put(:from, "__unconfigured_instance_static_plug")
def init(opts) do
opts
|> Keyword.put(:from, "__unconfigured_instance_static_plug")
@@
-30,10
+30,10
@@
defmodule Pleroma.Plugs.InstanceStatic do
|> Plug.Static.init()
end
|> Plug.Static.init()
end
- for only <-
@only
do
+ for only <-
Pleroma.Constants.static_only_files()
do
at = Plug.Router.Utils.split("/")
at = Plug.Router.Utils.split("/")
- def call(
conn = %{request_path: "/" <> unquote(only) <> _}
, opts) do
+ def call(
%{request_path: "/" <> unquote(only) <> _} = conn
, opts) do
call_static(
conn,
opts,
call_static(
conn,
opts,