credo lint
This commit is contained in:
parent
cfd2c08ef6
commit
f36851acbd
2 changed files with 7 additions and 5 deletions
|
|
@ -220,9 +220,10 @@ defmodule Pleroma.HTTP do
|
|||
defp query_encode_kv_pair({key, value}, rules \\ []) when is_list(rules) do
|
||||
cond do
|
||||
length(rules) > 0 ->
|
||||
# URI.encode_query/2 does not appear to follow spec and encodes all parts of our URI path Constant.
|
||||
# This appears to work outside of edge-cases like The Guardian Rich Media Cards,
|
||||
# keeping behavior same as with URI.encode_query/2 unless otherwise specified via rules.
|
||||
# URI.encode_query/2 does not appear to follow spec and encodes all part
|
||||
# of our URI path Constant. This appears to work outside of edge-cases
|
||||
# like The Guardian Rich Media Cards, keeping behavior same as with
|
||||
# URI.encode_query/2 unless otherwise specified via rules.
|
||||
(URI.encode_www_form(Kernel.to_string(key)) <>
|
||||
"=" <>
|
||||
URI.encode(value, fn byte ->
|
||||
|
|
|
|||
|
|
@ -101,10 +101,11 @@ defmodule Pleroma.Web.MediaProxy do
|
|||
end
|
||||
|
||||
# The URL coming into MediaProxy from the outside might have wrong %-encoding
|
||||
# (like older Pleroma versions)
|
||||
# (like older Pleroma versions).
|
||||
# This would cause an inconsistency with the encoded URL here and the requested
|
||||
# URL fixed with Pleroma.Tesla.Middleware.EncodeUrl.
|
||||
# End result is a failing HEAD request in Pleroma.Web.MediaProxy.MediaProxyController.handle_preview/2
|
||||
# End result is a failing HEAD request in
|
||||
# Pleroma.Web.MediaProxy.MediaProxyController.handle_preview/2
|
||||
def encode_url(url) do
|
||||
url = HTTP.encode_url(url)
|
||||
{base64, sig64} = base64_sig64(url)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue