aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Bernloehr <Heiko.Bernloehr@FreeIT.de>2014-05-07 05:25:27 +0200
committerHeiko Bernloehr <Heiko.Bernloehr@FreeIT.de>2014-05-07 05:30:17 +0200
commitec4cc7ad4911487c4d6c8fc0a1c96fe38bad1c1d (patch)
treeab82f9fef706979c197aed356cb3bc25036eb592
parent1b85be29cb56d6353c504a1bd2888be026c76114 (diff)
downloadecs2-ec4cc7ad4911487c4d6c8fc0a1c96fe38bad1c1d.tar.gz
ecs2-ec4cc7ad4911487c4d6c8fc0a1c96fe38bad1c1d.zip
Changed mime type detection in configs_controller.
Now we detect mime types like: "application/json; charset=utf-8" correct.
-rw-r--r--app/controllers/configs_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/configs_controller.rb b/app/controllers/configs_controller.rb
index a6a12cb..ee8658d 100644
--- a/app/controllers/configs_controller.rb
+++ b/app/controllers/configs_controller.rb
@@ -14,7 +14,7 @@ class ConfigsController < ApplicationController
end
def create
- unless Mime::Type.lookup(request.headers["CONTENT_TYPE"]).to_sym == :json
+ unless Mime::Type.lookup(request.headers["CONTENT_TYPE"]) =~ "application/json"
raise Ecs::InvalidMimetypeException, "Please provide \"Content-Type:\" header. Data format has to be in JSON (application/json)"
end