Skip to content

Commit 1d6b2de

Browse files
committed
Skip authentication if API key is empty
1 parent e65be0c commit 1d6b2de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/github_hook_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def update_repository(logger)
4545

4646
def check_enabled
4747
User.current = nil
48-
unless Setting.sys_api_enabled? && params[:key].to_s == Setting.sys_api_key
48+
unless Setting.sys_api_enabled? && (Setting.sys_api_key.empty? || params[:key].to_s == Setting.sys_api_key)
4949
render :text => 'Access denied. Repository management WS is disabled or key is invalid.', :status => 403
5050
return false
5151
end

0 commit comments

Comments
 (0)