From 4b7b48cbd30ad1dd05e0ff6af8626a09554c5f00 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Tue, 31 Jan 2023 02:51:13 -0800 Subject: [PATCH] Create edit_key global in ApiController --- app/controllers/api/v1/api_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/controllers/api/v1/api_controller.rb b/app/controllers/api/v1/api_controller.rb index 48aa741..fec9ce4 100644 --- a/app/controllers/api/v1/api_controller.rb +++ b/app/controllers/api/v1/api_controller.rb @@ -50,6 +50,12 @@ module Api @current_user end + def edit_key + @edit_key ||= request.headers['X-Edit-Key'] if request.headers['X-Edit-Key'] + + @edit_key + end + # Set the response content-type def content_type(content_type) response.headers['Content-Type'] = content_type