@webqit/webflo 0.8.54-0 → 0.8.55-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -141,7 +141,7 @@ export async function deploy(Ui, origin, flags = {}, layout = {}) {
|
|
|
141
141
|
export async function hook(Ui, event, deployCallback, flags = {}, layout = {}) {
|
|
142
142
|
const eventHandler = Webhooks.createEventHandler();
|
|
143
143
|
console.log('-------------------------event.request.headers', event.request.headers)
|
|
144
|
-
if (event.request.headers
|
|
144
|
+
if (event.request.headers.has('user-agent') && event.request.headers.get('user-agent').startsWith('GitHub-Hookshot/')) {
|
|
145
145
|
console.log('-------------------------111111111111111111')
|
|
146
146
|
const submits = await event.request.parse();
|
|
147
147
|
console.log('-------------------------submits', submits)
|
|
@@ -187,4 +187,32 @@ export async function hook(Ui, event, deployCallback, flags = {}, layout = {}) {
|
|
|
187
187
|
payload: submits.payload /* JSON object */,
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
|
-
}
|
|
190
|
+
}
|
|
191
|
+
-------------------------event.request.headers Headers {
|
|
192
|
+
[Symbol(map)]: [Object: null prototype] {
|
|
193
|
+
host: [ 'webqit.io' ],
|
|
194
|
+
'user-agent': [ 'GitHub-Hookshot/0b09aa9' ],
|
|
195
|
+
'content-length': [ '8832' ],
|
|
196
|
+
Accept: [ '*/*' ],
|
|
197
|
+
'x-github-delivery': [ 'df789d9e-6a54-11ec-8718-4cd5824afac9' ],
|
|
198
|
+
'x-github-event': [ 'push' ],
|
|
199
|
+
'x-github-hook-id': [ '276190607' ],
|
|
200
|
+
'x-github-hook-installation-target-id': [ '319800404' ],
|
|
201
|
+
'x-github-hook-installation-target-type': [ 'repository' ],
|
|
202
|
+
'x-hub-signature': [ 'sha1=498b45d6bf3403f5e28c17c9c77ff6666e9e4529' ],
|
|
203
|
+
'x-hub-signature-256': [
|
|
204
|
+
'sha256=034225e0d05dedd523bb429ddf9e61a4863ac7b45de3bb0b429205664e795b8f'
|
|
205
|
+
],
|
|
206
|
+
'content-type': [ 'application/json' ],
|
|
207
|
+
connection: [ 'close' ]
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
-------------------------event.request.headers Headers {
|
|
211
|
+
[Symbol(map)]: [Object: null prototype] {
|
|
212
|
+
Accept: [ '*/*' ],
|
|
213
|
+
'user-agent': [ 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)' ],
|
|
214
|
+
'accept-encoding': [ 'gzip,deflate' ],
|
|
215
|
+
connection: [ 'close' ],
|
|
216
|
+
host: [ 'webqit.io' ]
|
|
217
|
+
}
|
|
218
|
+
}
|