Merge branch 'fix/credo-issues' into 'develop'
[akkoma] / lib / pleroma / plugs / instance_static.ex
index 46ee77e111bbef9fad64718638d6ee5a5044dacb..41125921a9818ae1a5a045bfa85ffae3dd445f9f 100644 (file)
@@ -1,3 +1,7 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
 defmodule Pleroma.Plugs.InstanceStatic do
   @moduledoc """
   This is a shim to call `Plug.Static` but with runtime `from` configuration.
@@ -17,7 +21,7 @@ defmodule Pleroma.Plugs.InstanceStatic do
     end
   end
 
-  @only ~w(index.html static emoji packs sounds images instance favicon.png)
+  @only ~w(index.html static emoji packs sounds images instance favicon.png sw.js sw-pleroma.js)
 
   def init(opts) do
     opts
@@ -29,7 +33,7 @@ defmodule Pleroma.Plugs.InstanceStatic do
   for only <- @only do
     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,