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