]> cat aescling's git repositories - mastodon.git/commitdiff
Change max redirects followed to 2 (#5136)
authorEugen Rochko <eugen@zeonfederated.com>
Thu, 28 Sep 2017 21:20:08 +0000 (23:20 +0200)
committerGitHub <noreply@github.com>
Thu, 28 Sep 2017 21:20:08 +0000 (23:20 +0200)
I see no reason to allow more than that. Usually a redirect is
HTTP->HTTPS, then maybe URL structure changed, but more than that
is highly unlikely to be a legitimate use case.

app/lib/request.rb

index b083edaf776facd837022b65af12bfd59fb315d3..61311df6e4f7affd1bea1c042431bdc699764ced 100644 (file)
@@ -85,6 +85,6 @@ class Request
   end
 
   def http_client
-    HTTP.timeout(:per_operation, timeout).follow
+    HTTP.timeout(:per_operation, timeout).follow(max_hops: 2)
   end
 end