projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Only fetch if it's http.
[akkoma]
/
lib
/
pleroma
/
plugs
/
http_signature.ex
diff --git
a/lib/pleroma/plugs/http_signature.ex
b/lib/pleroma/plugs/http_signature.ex
index 7f40a20c0b62e0f30dcfd7098c94720d95b95e44..af160f3ee4fe3ec979795e32f12eb14c830bfa3f 100644
(file)
--- a/
lib/pleroma/plugs/http_signature.ex
+++ b/
lib/pleroma/plugs/http_signature.ex
@@
-14,12
+14,18
@@
defmodule Pleroma.Web.Plugs.HTTPSignaturePlug do
def call(conn, opts) do
user = conn.params["actor"]
Logger.debug("Checking sig for #{user}")
def call(conn, opts) do
user = conn.params["actor"]
Logger.debug("Checking sig for #{user}")
+
if get_req_header(conn, "signature") do
if get_req_header(conn, "signature") do
- conn = conn
- |> put_req_header("(request-target)", String.downcase("#{conn.method} #{conn.request_path}"))
+ conn =
+ conn
+ |> put_req_header(
+ "(request-target)",
+ String.downcase("#{conn.method}") <> " #{conn.request_path}"
+ )
assign(conn, :valid_signature, HTTPSignatures.validate_conn(conn))
else
assign(conn, :valid_signature, HTTPSignatures.validate_conn(conn))
else
+ Logger.debug("No signature header!")
conn
end
end
conn
end
end