projects
/
akkoma
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
report chat and gopher support at /nodeinfo/2.0.json
[akkoma]
/
lib
/
pleroma
/
plugs
/
digest.ex
1
defmodule Pleroma.Web.Plugs.DigestPlug do
2
alias Plug.Conn
3
require Logger
4
5
def read_body(conn, opts) do
6
{:ok, body, conn} = Conn.read_body(conn, opts)
7
digest = "SHA-256=" <> (:crypto.hash(:sha256, body) |> Base.encode64())
8
{:ok, body, Conn.assign(conn, :digest, digest)}
9
end
10
end