We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0064826 commit 74ce502Copy full SHA for 74ce502
1 file changed
lib/chatops/controller.rb
@@ -50,6 +50,11 @@ def execute_chatop
50
protected
51
52
def setup_params
53
+ json_body.each do |key, value|
54
+ next if params.has_key? key
55
+ params[key] = value
56
+ end
57
+
58
permitted_params = %i[
59
action
60
chatop
@@ -76,6 +81,14 @@ def setup_params
76
81
self.params = params.permit(*permitted_params)
77
82
end
78
83
84
+ def json_body
85
+ hash = {}
86
+ if request.content_type =~ %r/\Aapplication\/json\Z/i
87
+ hash = GitHub::JSON.parse(request.raw_post) || {}
88
89
+ hash.with_indifferent_access
90
91
79
92
def jsonrpc_params
80
93
params["params"] || {}
94
0 commit comments