Skip to content
This repository was archived by the owner on Jan 31, 2019. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions lib/services/web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,20 @@ class Service::Web < Service
string :url,
# old hooks send form params ?payload=JSON(...)
# new hooks should set content_type == 'json'
:content_type,

# 2 or 3
:ssl_version
:content_type

# adds a X-Hub-Signature of the body content
# X-Hub-Signature: sha1=....
password :secret

white_list :url, :content_type, :ssl_version
white_list :url, :content_type

boolean :insecure_ssl # :(

def receive_event
http.headers['X-GitHub-Event'] = event.to_s
http.headers['X-GitHub-Delivery'] = delivery_guid.to_s

if data['ssl_version'].to_i == 3
http.ssl[:version] = :sslv3
end

res = deliver data['url'], :content_type => data['content_type'],
:insecure_ssl => data['insecure_ssl'].to_i == 1, :secret => data['secret']

Expand Down