aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorArjun Satarkar <me@arjunsatarkar.net>2024-07-27 17:44:54 +0000
committerArjun Satarkar <me@arjunsatarkar.net>2024-07-27 17:44:54 +0000
commit9cee307e3a2a358734c1d0fb867efc338a52cda8 (patch)
tree85045d304581baba9653a8b9f806f82906ff0b73 /lib
parentf13770d71fd7817f7da160f5a115b86885690576 (diff)
downloadmediasync-9cee307e3a2a358734c1d0fb867efc338a52cda8.tar
mediasync-9cee307e3a2a358734c1d0fb867efc338a52cda8.tar.gz
mediasync-9cee307e3a2a358734c1d0fb867efc338a52cda8.zip
Don't use Application.compile_env
Everything should be runtime config.
Diffstat (limited to 'lib')
-rw-r--r--lib/mediasync/http_errors.ex16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/mediasync/http_errors.ex b/lib/mediasync/http_errors.ex
index cbbb613..5df85fd 100644
--- a/lib/mediasync/http_errors.ex
+++ b/lib/mediasync/http_errors.ex
@@ -2,14 +2,6 @@ defmodule Mediasync.HTTPErrors do
import Plug.Conn
import Mediasync.Utils
- @video_url_too_large Jason.encode!(
- %{
- "error" => "videoUrlTooLarge",
- "maxSize" => Application.compile_env(:mediasync, :max_video_url_size)
- },
- pretty: true
- )
-
@spec send_video_url_too_large(Plug.Conn.t()) :: Plug.Conn.t()
@spec send_video_url_too_large(Plug.Conn.t(), []) :: Plug.Conn.t()
def send_video_url_too_large(conn, _opts \\ []) do
@@ -17,7 +9,13 @@ defmodule Mediasync.HTTPErrors do
|> put_json_content_type()
|> send_resp(
400,
- @video_url_too_large
+ Jason.encode!(
+ %{
+ "error" => "videoUrlTooLarge",
+ "maxSize" => Application.fetch_env!(:mediasync, :max_video_url_size)
+ },
+ pretty: true
+ )
)
end