diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-05-02 15:44:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-02 15:44:22 +0200 |
commit | 965345316fb3fef640a6bcc463d09d4a38b28608 (patch) | |
tree | 25e2eaaf9108ab677a53ff9d56b9410013cba38f /app/lib | |
parent | 6c40e567aaa166eb618c316d1de2eb81b8eced9a (diff) |
Guard against nil URLs in Request class (#7284)
Fix #7265
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/request.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/lib/request.rb b/app/lib/request.rb index 0acd654da..00f94dacf 100644 --- a/app/lib/request.rb +++ b/app/lib/request.rb @@ -9,12 +9,15 @@ class Request include RoutingHelper def initialize(verb, url, **options) + raise ArgumentError if url.blank? + @verb = verb @url = Addressable::URI.parse(url).normalize @options = options.merge(use_proxy? ? Rails.configuration.x.http_client_proxy : { socket_class: Socket }) @headers = {} raise Mastodon::HostValidationError, 'Instance does not support hidden service connections' if block_hidden_service? + set_common_headers! set_digest! if options.key?(:body) end |