From c2f268026d1d2fe93ac692f09c11bc506ab1c528 Mon Sep 17 00:00:00 2001 From: Marcos Beirigo Date: Wed, 26 Oct 2016 17:19:12 +0800 Subject: [PATCH] Fixing Rails 5.1 warnings Fixing the two warnings listed bellow: - DEPRECATION WARNING: env is deprecated and will be removed from Rails 5.1 - DEPRECATION WARNING: `render :text` is deprecated because it does not actually render a `text/plain` response. Switch to `render plain: 'plain text'` to render as `text/plain`, `render html: 'HTML'` to render as `text/html`, or `render body: 'raw'` to match the deprecated behavior and render with the default Content-Type, which is `text/plain`. --- lib/reverse_proxy/controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/reverse_proxy/controller.rb b/lib/reverse_proxy/controller.rb index 6185e3d..63b122e 100644 --- a/lib/reverse_proxy/controller.rb +++ b/lib/reverse_proxy/controller.rb @@ -49,14 +49,14 @@ module ReverseProxy if content_type and content_type.match /image/ send_data body, content_type: content_type, disposition: "inline", status: code else - render text: body, content_type: content_type, status: code + render body: body, content_type: content_type, status: code end end yield(config) if block_given? end - client.request(env, options) + client.request(request.env, options) end end -end \ No newline at end of file +end