Merge branch 'streaming-api-url-fix' into 'develop'
Fix WebSocket streaming API URL. See merge request pleroma/pleroma!756
This commit is contained in:
commit
ffbf306c9a
|
@ -82,4 +82,8 @@ def load_from_system_env(config) do
|
||||||
port = System.get_env("PORT") || raise "expected the PORT environment variable to be set"
|
port = System.get_env("PORT") || raise "expected the PORT environment variable to be set"
|
||||||
{:ok, Keyword.put(config, :http, [:inet6, port: port])}
|
{:ok, Keyword.put(config, :http, [:inet6, port: port])}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def websocket_url do
|
||||||
|
String.replace_leading(url(), "http", "ws")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -138,7 +138,7 @@ def masto_instance(conn, _params) do
|
||||||
version: "#{@mastodon_api_level} (compatible; #{Pleroma.Application.named_version()})",
|
version: "#{@mastodon_api_level} (compatible; #{Pleroma.Application.named_version()})",
|
||||||
email: Keyword.get(instance, :email),
|
email: Keyword.get(instance, :email),
|
||||||
urls: %{
|
urls: %{
|
||||||
streaming_api: String.replace(Pleroma.Web.Endpoint.static_url(), "http", "ws")
|
streaming_api: Pleroma.Web.Endpoint.websocket_url()
|
||||||
},
|
},
|
||||||
stats: Stats.get_stats(),
|
stats: Stats.get_stats(),
|
||||||
thumbnail: Web.base_url() <> "/instance/thumbnail.jpeg",
|
thumbnail: Web.base_url() <> "/instance/thumbnail.jpeg",
|
||||||
|
|
Loading…
Reference in New Issue