File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,13 @@ def edit_issue(number):
50
50
edit issues.
51
51
'''
52
52
path = 'repos/{0}/{1}' .format (ISSUES_PATH , number )
53
- edit = proxy_request ('patch' , path , data = request .data )
54
- return (edit .content , edit .status_code , {'content-type' : JSON_MIME })
53
+ # we can only change the state of the issue: close or open
54
+ states_list = ['{"state": "closed"}' , '{"state": "open"}' ]
55
+ if request .data in states_list :
56
+ edit = proxy_request ('patch' , path , data = request .data )
57
+ return (edit .content , edit .status_code , {'content-type' : JSON_MIME })
58
+ else :
59
+ abort (403 )
55
60
56
61
57
62
@api .route ('/issues' )
@@ -205,7 +210,7 @@ def proxy_comments(number):
205
210
Either as an authed user, or as one of our proxy bots.
206
211
'''
207
212
params = request .args .copy ()
208
- if request .method == 'POST' :
213
+ if request .method == 'POST' and g . user :
209
214
path = 'repos/{0}/{1}/comments' .format (ISSUES_PATH , number )
210
215
return api_request ('post' , path , params = params ,
211
216
data = get_comment_data (request .data ))
You can’t perform that action at this time.
0 commit comments