From 3b72b8d0bb5d139301773c631adbb470ff5c9df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Mon, 30 Apr 2018 15:12:53 +0200 Subject: [PATCH] Pass the headers to the set_response_headers directly, not the response --- lib/remote_storage/rest_provider.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/remote_storage/rest_provider.rb b/lib/remote_storage/rest_provider.rb index 1b59601..c394689 100644 --- a/lib/remote_storage/rest_provider.rb +++ b/lib/remote_storage/rest_provider.rb @@ -67,7 +67,7 @@ module RemoteStorage res = do_get_request(url) - set_response_headers(res) + set_response_headers(res.headers) return res.body rescue RestClient::ResourceNotFound @@ -208,11 +208,11 @@ module RemoteStorage raise NotImplementedError end - def set_response_headers(response) - server.headers["ETag"] = format_etag(response.headers[:etag]) - server.headers["Content-Type"] = response.headers[:content_type] - server.headers["Content-Length"] = response.headers[:content_length] - server.headers["Last-Modified"] = response.headers[:last_modified] + def set_response_headers(headers) + server.headers["ETag"] = format_etag(headers[:etag]) + server.headers["Content-Type"] = headers[:content_type] + server.headers["Content-Length"] = headers[:content_length] + server.headers["Last-Modified"] = headers[:last_modified] end def extract_category(directory)