From 07d513f5f592e56581aca94bcef1599b613fdcca Mon Sep 17 00:00:00 2001 From: Georg Gadinger Date: Fri, 31 Mar 2017 23:35:45 +0200 Subject: [PATCH] a --- lib/exporter.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/exporter.rb b/lib/exporter.rb index 49db2ad9..902ddba2 100644 --- a/lib/exporter.rb +++ b/lib/exporter.rb @@ -82,7 +82,7 @@ class Exporter File.open target_file, 'wb' do |f| f.binmode data = if url.start_with?('/system') - File.read(Rails.root.join('public', url)) + File.read(Rails.root.join('public', url.sub(%r(\A/+), ''))) else HTTParty.get(url).parsed_response end @@ -98,7 +98,7 @@ class Exporter File.open target_file, 'wb' do |f| f.binmode data = if url.start_with?('/system') - File.read(Rails.root.join('public', url)) + File.read(Rails.root.join('public', url.sub(%r(\A/+), ''))) else HTTParty.get(url).parsed_response end