Some servers send empty lease_seconds requests...
authorRoger Braun <roger@rogerbraun.net>
Mon, 1 May 2017 18:09:00 +0000 (20:09 +0200)
committerRoger Braun <roger@rogerbraun.net>
Mon, 1 May 2017 18:09:00 +0000 (20:09 +0200)
lib/pleroma/web/websub/websub.ex

index b279a50609cad64f3e33d371c6845c9737ce5978..905c237a088ecb9ca426eca77181f9c1c1a2ce6e 100644 (file)
@@ -89,6 +89,11 @@ defmodule Pleroma.Web.Websub do
     Repo.get_by(WebsubServerSubscription, topic: topic, callback: callback) || %WebsubServerSubscription{}
   end
 
+  # Temp hack for mastodon.
+  defp lease_time(%{"hub.lease_seconds" => ""}) do
+    {:ok, 60 * 60 * 24 * 3} # three days
+  end
+
   defp lease_time(%{"hub.lease_seconds" => lease_seconds}) do
     {:ok, String.to_integer(lease_seconds)}
   end