summaryrefslogtreecommitdiff
path: root/lib/gitlab_net.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab_net.rb')
-rw-r--r--lib/gitlab_net.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb
index ddf2a06..503a267 100644
--- a/lib/gitlab_net.rb
+++ b/lib/gitlab_net.rb
@@ -56,9 +56,11 @@ class GitlabNet
get("#{host}/check", read_timeout: CHECK_TIMEOUT)
end
- def ssh_key(fingerprint)
+ def authorized_key(fingerprint)
resp = get("#{host}/ssh-key?fingerprint=#{fingerprint}")
- JSON.parse(resp.body) rescue nil
+ JSON.parse(resp.body) if resp.code == "200"
+ rescue
+ nil
end
protected