diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-02-18 14:58:20 -0800 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-02-18 14:58:20 -0800 |
commit | 558dd811971776fc4a921b79296f5d792b245686 (patch) | |
tree | 03276f73e69391fe8f9377f7d672cb2dd8ea710e /lib | |
parent | 833d4dddf2fc3a933a28b4deb60ef6a3dc7eb0fb (diff) | |
download | gitlab-ce-558dd811971776fc4a921b79296f5d792b245686.tar.gz |
Improve broadcast message API
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/helpers.rb | 4 | ||||
-rw-r--r-- | lib/api/internal.rb | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index a50ee4659a3..228a719fbdf 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -83,7 +83,7 @@ module API end def authenticate_by_gitlab_shell_token! - unauthorized! unless secret_token == params['secret_token'] + unauthorized! unless secret_token == params['secret_token'].try(:chomp) end def authenticated_as_admin! @@ -236,7 +236,7 @@ module API end def secret_token - File.read(Rails.root.join('.gitlab_shell_secret')) + File.read(Rails.root.join('.gitlab_shell_secret')).chomp end def handle_member_errors(errors) diff --git a/lib/api/internal.rb b/lib/api/internal.rb index 04ff049989b..ba3fe619b92 100644 --- a/lib/api/internal.rb +++ b/lib/api/internal.rb @@ -73,6 +73,8 @@ module API get "/broadcast_message" do if message = BroadcastMessage.current present message, with: Entities::BroadcastMessage + else + {} end end end |