add logging stuff
This commit is contained in:
parent
d785dd371c
commit
6b054a0944
1 changed files with 5 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
defmodule ZoeyscomputerWeb.DiscordHandler do
|
defmodule ZoeyscomputerWeb.DiscordHandler do
|
||||||
|
require Logger
|
||||||
alias ExAws.S3
|
alias ExAws.S3
|
||||||
import Plug.Conn
|
import Plug.Conn
|
||||||
import Mogrify
|
import Mogrify
|
||||||
|
|
@ -6,7 +7,10 @@ defmodule ZoeyscomputerWeb.DiscordHandler do
|
||||||
def init(opts), do: opts
|
def init(opts), do: opts
|
||||||
|
|
||||||
def call(%{path_info: ["images", _id]} = conn, _opts) do
|
def call(%{path_info: ["images", _id]} = conn, _opts) do
|
||||||
case get_req_header(conn, "user-agent") do
|
user_agent = get_req_header(conn, "user-agent")
|
||||||
|
Logger.info("user-agent: #{user_agent}")
|
||||||
|
|
||||||
|
case user_agent do
|
||||||
["Mozilla/5.0 (compatible; Discordbot/" <> _rest] -> handle_discord(conn)
|
["Mozilla/5.0 (compatible; Discordbot/" <> _rest] -> handle_discord(conn)
|
||||||
_ -> conn
|
_ -> conn
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue