projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
97252a2
)
status_code -> status
author
Maksim Pechnikov
<parallel588@gmail.com>
Sun, 2 Dec 2018 14:08:36 +0000
(17:08 +0300)
committer
Maksim Pechnikov
<parallel588@gmail.com>
Tue, 4 Dec 2018 11:04:06 +0000
(14:04 +0300)
lib/pleroma/uploaders/mdii.ex
patch
|
blob
|
history
lib/pleroma/uploaders/swift/keystone.ex
patch
|
blob
|
history
lib/pleroma/uploaders/swift/swift.ex
patch
|
blob
|
history
lib/pleroma/web/activity_pub/activity_pub.ex
patch
|
blob
|
history
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
patch
|
blob
|
history
lib/pleroma/web/ostatus/ostatus.ex
patch
|
blob
|
history
lib/pleroma/web/web_finger/web_finger.ex
patch
|
blob
|
history
lib/pleroma/web/websub/websub.ex
patch
|
blob
|
history
test/web/websub/websub_test.exs
patch
|
blob
|
history
diff --git
a/lib/pleroma/uploaders/mdii.ex
b/lib/pleroma/uploaders/mdii.ex
index 35d36d3e4e32065f7221fcc12f0c0ce43be74740..820cf88f5119085558131445c138879426bdc553 100644
(file)
--- a/
lib/pleroma/uploaders/mdii.ex
+++ b/
lib/pleroma/uploaders/mdii.ex
@@
-20,7
+20,7
@@
defmodule Pleroma.Uploaders.MDII do
extension = String.split(upload.name, ".") |> List.last()
query = "#{cgi}?#{extension}"
extension = String.split(upload.name, ".") |> List.last()
query = "#{cgi}?#{extension}"
- with {:ok, %{status
_code
: 200, body: body}} <- @httpoison.post(query, file_data) do
+ with {:ok, %{status: 200, body: body}} <- @httpoison.post(query, file_data) do
remote_file_name = String.split(body) |> List.first()
public_url = "#{files}/#{remote_file_name}.#{extension}"
{:ok, {:url, public_url}}
remote_file_name = String.split(body) |> List.first()
public_url = "#{files}/#{remote_file_name}.#{extension}"
{:ok, {:url, public_url}}
diff --git
a/lib/pleroma/uploaders/swift/keystone.ex
b/lib/pleroma/uploaders/swift/keystone.ex
index e578b3c619e850a20d1bfa68f281c841fb1778fa..4aed977b153f54735b8ecb83e2577c733d53a6c4 100644
(file)
--- a/
lib/pleroma/uploaders/swift/keystone.ex
+++ b/
lib/pleroma/uploaders/swift/keystone.ex
@@
-25,10
+25,10
@@
defmodule Pleroma.Uploaders.Swift.Keystone do
["Content-Type": "application/json"],
hackney: [:insecure]
) do
["Content-Type": "application/json"],
hackney: [:insecure]
) do
- {:ok, %
HTTPoison.Response{status_code
: 200, body: body}} ->
+ {:ok, %
Tesla.Env{status
: 200, body: body}} ->
body["access"]["token"]["id"]
body["access"]["token"]["id"]
- {:ok, %
HTTPoison.Response{status_code
: _}} ->
+ {:ok, %
Tesla.Env{status
: _}} ->
""
end
end
""
end
end
diff --git
a/lib/pleroma/uploaders/swift/swift.ex
b/lib/pleroma/uploaders/swift/swift.ex
index 1e865f1017efdae416fe479e6bffa7fd46ba93f9..a5b3d2852639fe8bbd828325ff3d7e2023310704 100644
(file)
--- a/
lib/pleroma/uploaders/swift/swift.ex
+++ b/
lib/pleroma/uploaders/swift/swift.ex
@@
-13,10
+13,10
@@
defmodule Pleroma.Uploaders.Swift.Client do
token = Pleroma.Uploaders.Swift.Keystone.get_token()
case put("#{filename}", body, "X-Auth-Token": token, "Content-Type": content_type) do
token = Pleroma.Uploaders.Swift.Keystone.get_token()
case put("#{filename}", body, "X-Auth-Token": token, "Content-Type": content_type) do
- {:ok, %
HTTPoison.Response{status_code
: 201}} ->
+ {:ok, %
Tesla.Env{status
: 201}} ->
{:ok, {:file, filename}}
{:ok, {:file, filename}}
- {:ok, %
HTTPoison.Response{status_code
: 401}} ->
+ {:ok, %
Tesla.Env{status
: 401}} ->
{:error, "Unauthorized, Bad Token"}
{:error, _} ->
{:error, "Unauthorized, Bad Token"}
{:error, _} ->
diff --git
a/lib/pleroma/web/activity_pub/activity_pub.ex
b/lib/pleroma/web/activity_pub/activity_pub.ex
index 7e207c6201b1eb330c9c4737cfb437dd5a051ef4..60253a715909edc9f781ba22d9957db629388c67 100644
(file)
--- a/
lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/
lib/pleroma/web/activity_pub/activity_pub.ex
@@
-762,7
+762,7
@@
defmodule Pleroma.Web.ActivityPub.ActivityPub do
Logger.info("Fetching #{id} via AP")
with true <- String.starts_with?(id, "http"),
Logger.info("Fetching #{id} via AP")
with true <- String.starts_with?(id, "http"),
- {:ok, %{body: body, status
_code
: code}} when code in 200..299 <-
+ {:ok, %{body: body, status: code}} when code in 200..299 <-
@httpoison.get(
id,
[Accept: "application/activity+json"],
@httpoison.get(
id,
[Accept: "application/activity+json"],
diff --git
a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
index 543fdf4161cad45020110262c1820abcc7d7ea3c..ea64f163db1037b0c53724d84932757d9ff5fbbf 100644
(file)
--- a/
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
+++ b/
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
@@
-1168,7
+1168,7
@@
defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
user = user.nickname
url = String.replace(api, "{{host}}", host) |> String.replace("{{user}}", user)
user = user.nickname
url = String.replace(api, "{{host}}", host) |> String.replace("{{user}}", user)
- with {:ok, %{status
_code
: 200, body: body}} <-
+ with {:ok, %{status: 200, body: body}} <-
@httpoison.get(url, [], timeout: timeout, recv_timeout: timeout),
{:ok, data} <- Jason.decode(body) do
data2 =
@httpoison.get(url, [], timeout: timeout, recv_timeout: timeout),
{:ok, data} <- Jason.decode(body) do
data2 =
diff --git
a/lib/pleroma/web/ostatus/ostatus.ex
b/lib/pleroma/web/ostatus/ostatus.ex
index 6a27f1730c83c3c35498411e0bf5f5733dc19128..67df354dbb1490f16fec9a34780f0c687aa03afc 100644
(file)
--- a/
lib/pleroma/web/ostatus/ostatus.ex
+++ b/
lib/pleroma/web/ostatus/ostatus.ex
@@
-346,13
+346,15
@@
defmodule Pleroma.Web.OStatus do
def fetch_activity_from_atom_url(url) do
with true <- String.starts_with?(url, "http"),
def fetch_activity_from_atom_url(url) do
with true <- String.starts_with?(url, "http"),
- {:ok, %{body: body, status
_code
: code}} when code in 200..299 <-
+ {:ok, %{body: body, status: code}} when code in 200..299 <-
@httpoison.get(
url,
[Accept: "application/atom+xml"],
follow_redirect: true,
@httpoison.get(
url,
[Accept: "application/atom+xml"],
follow_redirect: true,
- timeout: 10000,
- recv_timeout: 20000
+ adapter: [
+ timeout: 10000,
+ recv_timeout: 20000
+ ]
) do
Logger.debug("Got document from #{url}, handling...")
handle_incoming(body)
) do
Logger.debug("Got document from #{url}, handling...")
handle_incoming(body)
diff --git
a/lib/pleroma/web/web_finger/web_finger.ex
b/lib/pleroma/web/web_finger/web_finger.ex
index eaee3a8c698cd37a69c6c1aa96e976c3eb65ba52..99c65a6bfd14dfeb51d3fba6e8a31496c9750c66 100644
(file)
--- a/
lib/pleroma/web/web_finger/web_finger.ex
+++ b/
lib/pleroma/web/web_finger/web_finger.ex
@@
-220,7
+220,7
@@
defmodule Pleroma.Web.WebFinger do
end
def find_lrdd_template(domain) do
end
def find_lrdd_template(domain) do
- with {:ok, %{status
_code: status_code, body: body}} when status_code
in 200..299 <-
+ with {:ok, %{status
: status, body: body}} when status
in 200..299 <-
@httpoison.get("http://#{domain}/.well-known/host-meta", [], follow_redirect: true) do
get_template_from_xml(body)
else
@httpoison.get("http://#{domain}/.well-known/host-meta", [], follow_redirect: true) do
get_template_from_xml(body)
else
@@
-259,7
+259,7
@@
defmodule Pleroma.Web.WebFinger do
[Accept: "application/xrd+xml,application/jrd+json"],
follow_redirect: true
),
[Accept: "application/xrd+xml,application/jrd+json"],
follow_redirect: true
),
- {:ok, %{status
_code: status_code, body: body}} when status_code
in 200..299 <- response do
+ {:ok, %{status
: status, body: body}} when status
in 200..299 <- response do
doc = XML.parse_document(body)
if doc != :error do
doc = XML.parse_document(body)
if doc != :error do
diff --git
a/lib/pleroma/web/websub/websub.ex
b/lib/pleroma/web/websub/websub.ex
index ed1a99d8d4d33c878a5af655794ab6b879b4ad44..0761b54756b8e09e074da23899fff8ecde015297 100644
(file)
--- a/
lib/pleroma/web/websub/websub.ex
+++ b/
lib/pleroma/web/websub/websub.ex
@@
-173,7
+173,7
@@
defmodule Pleroma.Web.Websub do
def gather_feed_data(topic, getter \\ &@httpoison.get/1) do
with {:ok, response} <- getter.(topic),
def gather_feed_data(topic, getter \\ &@httpoison.get/1) do
with {:ok, response} <- getter.(topic),
- status
_code when status_code
in 200..299 <- response.status,
+ status
when status
in 200..299 <- response.status,
body <- response.body,
doc <- XML.parse_document(body),
uri when not is_nil(uri) <- XML.string_from_xpath("/feed/author[1]/uri", doc),
body <- response.body,
doc <- XML.parse_document(body),
uri when not is_nil(uri) <- XML.string_from_xpath("/feed/author[1]/uri", doc),
diff --git
a/test/web/websub/websub_test.exs
b/test/web/websub/websub_test.exs
index 0b8bfda2d1159916cc4669b8231e147748f829c6..f3d2da81ab2672daac16c34e075023c54b293006 100644
(file)
--- a/
test/web/websub/websub_test.exs
+++ b/
test/web/websub/websub_test.exs
@@
-184,7
+184,7
@@
defmodule Pleroma.Web.WebsubTest do
websub = insert(:websub_client_subscription, %{hub: hub, topic: topic})
poster = fn ^hub, {:form, _data}, _headers ->
websub = insert(:websub_client_subscription, %{hub: hub, topic: topic})
poster = fn ^hub, {:form, _data}, _headers ->
- {:ok, %{status
_code
: 202}}
+ {:ok, %{status: 202}}
end
{:error, websub} = Websub.request_subscription(websub, poster, 1000)
end
{:error, websub} = Websub.request_subscription(websub, poster, 1000)
@@
-193,7
+193,7
@@
defmodule Pleroma.Web.WebsubTest do
websub = insert(:websub_client_subscription, %{hub: hub, topic: topic})
poster = fn ^hub, {:form, _data}, _headers ->
websub = insert(:websub_client_subscription, %{hub: hub, topic: topic})
poster = fn ^hub, {:form, _data}, _headers ->
- {:ok, %{status
_code
: 400}}
+ {:ok, %{status: 400}}
end
{:error, websub} = Websub.request_subscription(websub, poster, 1000)
end
{:error, websub} = Websub.request_subscription(websub, poster, 1000)