Create edit_key global in ApiController

This commit is contained in:
Justin Edmund 2023-01-31 02:51:13 -08:00
parent 6b24970c54
commit 4b7b48cbd3

View file

@ -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