File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ class App < Sinatra::Base
3232 end
3333
3434 get '/' do
35- redirect "http://about. travis-ci.org "
35+ redirect "http://travis-ci.com "
3636 end
3737
3838 # Used for new relic uptime monitoring
@@ -205,21 +205,23 @@ def push_head_commit
205205 end
206206
207207 def delivery_guid
208- env [ 'HTTP_X_GITHUB_GUID' ]
208+ env [ 'HTTP_X_GITHUB_GUID' ] || env [ 'HTTP_X_GITHUB_DELIVERY' ]
209209 end
210210
211211 def payload
212- if github_pr_event ?
212+ if ! params [ :payload ] . blank ?
213213 params [ :payload ]
214- elsif github_apps_event?
215- begin
216- @_parsed_json ||= JSON . parse ( request . body . read )
217- rescue JSON ::ParserError
218- nil
219- end
214+ elsif !request_body . blank?
215+ request_body
216+ else
217+ nil
220218 end
221219 end
222220
221+ def request_body
222+ @_request_body ||= request . body . read
223+ end
224+
223225 def slug
224226 "#{ owner_login } /#{ repository_name } "
225227 end
Original file line number Diff line number Diff line change 1313 end
1414
1515 def create ( opts = { } )
16- params = { :payload => ( opts [ :payload ] || payload ) }
16+ params = { }
17+
18+ if params_payload = ( opts [ :payload ] || payload )
19+ params [ :payload ] = params_payload
20+ end
21+
1722 headers = { 'HTTP_X_GITHUB_EVENT' => 'push' , 'HTTP_X_GITHUB_GUID' => 'abc123' }
1823 headers . merge! ( opts . delete ( :headers ) || { } )
1924
You can’t perform that action at this time.
0 commit comments