From 3b1bf5b4959b8bf31a31117659c53a8881d59686 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sat, 11 Jan 2020 02:47:13 -0600 Subject: normalize app name when comparing against monsterfork api env vars --- app/controllers/api/base_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/controllers/api/base_controller.rb b/app/controllers/api/base_controller.rb index dd81b09e5..ddadfd486 100644 --- a/app/controllers/api/base_controller.rb +++ b/app/controllers/api/base_controller.rb @@ -104,7 +104,7 @@ class Api::BaseController < ApplicationController def _monsterfork_api return :full if current_user.nil? return current_user.monsterfork_api.to_sym unless doorkeeper_token && doorkeeper_token.application.present? - app = doorkeeper_token.application.name.downcase.strip.gsub(/ +/, '_') + app = doorkeeper_token.application.name.downcase.strip.gsub(/ +/, '_').gsub(/[^\w.-]/, '') return :vanilla if ENV.fetch('MONSTERFORK_API_FORCE_VANILLA', '').downcase.split.include?(app) return :basic if ENV.fetch('MONSTERFORK_API_FORCE_BASIC', '').downcase.split.include?(app) return :full if ENV.fetch('MONSTERFORK_API_FORCE_FULL', '').downcase.split.include?(app) -- cgit