about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-01-11 02:47:13 -0600
committermultiple creatures <dev@multiple-creature.party>2020-01-11 02:47:13 -0600
commit3b1bf5b4959b8bf31a31117659c53a8881d59686 (patch)
tree0a3fed4794843ddb485c5aa79ceca5f8cce520ef /app/controllers
parent36a4bcb035eef56951b207ab9a5da0bdfd82d926 (diff)
normalize app name when comparing against monsterfork api env vars
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/api/base_controller.rb2
1 files changed, 1 insertions, 1 deletions
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)