Skip to content

Commit e60af16

Browse files
committed
fix ensure_chatops_authenticated return
1 parent eabf05f commit e60af16

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/chatops/controller.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,16 @@ def ensure_chatops_authenticated
122122

123123
body = request.raw_post || ""
124124

125-
valid = @chatops_urls.any? do |url|
125+
@chatops_urls.each do |url|
126126
signature_string = [url, @chatops_nonce, @chatops_timestamp, body].join("\n")
127127
# We return this just to aid client debugging.
128128
response.headers["Chatops-Signature-String"] = Base64.strict_encode64(signature_string)
129129
if signature_valid?(Chatops.public_key, @chatops_signature, signature_string) ||
130130
signature_valid?(Chatops.alt_public_key, @chatops_signature, signature_string)
131-
return true
131+
return true
132132
end
133133
end
134134

135-
return true if valid
136135
return jsonrpc_error(-32800, 403, "Not authorized")
137136
end
138137

0 commit comments

Comments
 (0)