make sure api key finders are strings
This commit is contained in:
parent
6344d7ce3e
commit
1f4e3305b9
@ -8,7 +8,7 @@ class ApiKeysController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
current_user.api_keys.find_by_api_key(params[:id]).try(:destroy)
|
current_user.api_keys.find_by_api_key(params[:id].to_s).try(:destroy)
|
||||||
redirect_to :back
|
redirect_to :back
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ class ApiKeysController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@api_key = current_user.api_keys.find_by_api_key(params[:id])
|
@api_key = current_user.api_keys.find_by_api_key(params[:id].to_s)
|
||||||
@api_key.update_attributes(api_key_params)
|
@api_key.update_attributes(api_key_params)
|
||||||
redirect_to :back
|
redirect_to :back
|
||||||
end
|
end
|
||||||
|
@ -201,7 +201,7 @@ class ApplicationController < ActionController::Base
|
|||||||
def get_apikey
|
def get_apikey
|
||||||
key = get_header_value(HTTP_HEADER_API_KEY_NAME) || params[:key] || params[:api_key] || params[:apikey]
|
key = get_header_value(HTTP_HEADER_API_KEY_NAME) || params[:key] || params[:api_key] || params[:apikey]
|
||||||
key.strip if key.present?
|
key.strip if key.present?
|
||||||
return key
|
return key.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
# get specified header value
|
# get specified header value
|
||||||
|
Loading…
Reference in New Issue
Block a user