diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-10-28 18:56:13 -0200 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-10-31 12:32:18 -0200 |
commit | 554cf1e23bdfaf5ecc1588c0c3dce5ea6a008b24 (patch) | |
tree | 6808800b44d944b6111d877a0ec19f025cf871c5 /lib/api/helpers.rb | |
parent | 44cbfeaba87b2b659f22c802920004d6dff1b53a (diff) | |
download | gitlab-ce-issue_23242.tar.gz |
Fix project features default valuesissue_23242
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r-- | lib/api/helpers.rb | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 8025581d3ca..3c9d7b1aaef 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -1,18 +1,12 @@ module API module Helpers + include Gitlab::Utils + PRIVATE_TOKEN_HEADER = "HTTP_PRIVATE_TOKEN" PRIVATE_TOKEN_PARAM = :private_token SUDO_HEADER = "HTTP_SUDO" SUDO_PARAM = :sudo - def to_boolean(value) - return value if [true, false].include?(value) - return true if value =~ /^(true|t|yes|y|1|on)$/i - return false if value =~ /^(false|f|no|n|0|off)$/i - - nil - end - def private_token params[PRIVATE_TOKEN_PARAM] || env[PRIVATE_TOKEN_HEADER] end |