Fix ThreadResolveWorker getting queued with invalid URLs (#9628)
This commit is contained in:
parent
17cd91c777
commit
aa9a20cde0
3 changed files with 14 additions and 2 deletions
|
@ -66,6 +66,18 @@ class Request
|
|||
(@account ? @headers.merge('Signature' => signature) : @headers).without(REQUEST_TARGET)
|
||||
end
|
||||
|
||||
class << self
|
||||
def valid_url?(url)
|
||||
begin
|
||||
parsed_url = Addressable::URI.parse(url)
|
||||
rescue Addressable::URI::InvalidURIError
|
||||
return false
|
||||
end
|
||||
|
||||
%w(http https).include?(parsed_url.scheme) && parsed_url.host.present?
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_common_headers!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue