791ca43f3f
Don't allow line breaks on HTTP headers See merge request gitlab/gitlabhq!2277 (cherry picked from commit 7fc0a6fc096768a5604d6dd24d7d952e53300c82) 073b8f9c Don't allow line breaks on HTTP headers
16 lines
437 B
Ruby
16 lines
437 B
Ruby
class WebHook < ActiveRecord::Base
|
|
include Sortable
|
|
|
|
has_many :web_hook_logs, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
|
|
|
|
validates :url, presence: true, url: true
|
|
validates :token, format: { without: /\n/ }
|
|
|
|
def execute(data, hook_name)
|
|
WebHookService.new(self, data, hook_name).execute
|
|
end
|
|
|
|
def async_execute(data, hook_name)
|
|
WebHookService.new(self, data, hook_name).async_execute
|
|
end
|
|
end
|