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
32
32
end
33
33
34
34
get '/' do
35
- redirect "http://about. travis-ci.org "
35
+ redirect "http://travis-ci.com "
36
36
end
37
37
38
38
# Used for new relic uptime monitoring
@@ -205,21 +205,23 @@ def push_head_commit
205
205
end
206
206
207
207
def delivery_guid
208
- env [ 'HTTP_X_GITHUB_GUID' ]
208
+ env [ 'HTTP_X_GITHUB_GUID' ] || env [ 'HTTP_X_GITHUB_DELIVERY' ]
209
209
end
210
210
211
211
def payload
212
- if github_pr_event ?
212
+ if ! params [ :payload ] . blank ?
213
213
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
220
218
end
221
219
end
222
220
221
+ def request_body
222
+ @_request_body ||= request . body . read
223
+ end
224
+
223
225
def slug
224
226
"#{ owner_login } /#{ repository_name } "
225
227
end
Original file line number Diff line number Diff line change 13
13
end
14
14
15
15
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
+
17
22
headers = { 'HTTP_X_GITHUB_EVENT' => 'push' , 'HTTP_X_GITHUB_GUID' => 'abc123' }
18
23
headers . merge! ( opts . delete ( :headers ) || { } )
19
24
You can’t perform that action at this time.
0 commit comments