1
0
mirror of https://github.com/meineerde/rackstash.git synced 2025-10-17 14:01:01 +00:00

Correctly parse opaque URLs for the File adapter

This commit is contained in:
Holger Just 2019-09-17 20:43:26 +02:00
parent 6831e3db55
commit 8943e18aca

View File

@ -89,13 +89,13 @@ module Rackstash
def self.from_uri(uri)
uri = URI(uri)
if (uri.scheme || uri.opaque) == 'file'.freeze
if uri.scheme == 'file'.freeze
file_options = parse_uri_options(uri)
if file_options[:auto_reopen] =~ /\A(:?false|0)?\z/i
file_options[:auto_reopen] = false
end
new(uri.path, **file_options)
new(uri.path || uri.opaque, **file_options)
else
raise ArgumentError, "Invalid URI: #{uri}"
end