zapier-platform icon indicating copy to clipboard operation
zapier-platform copied to clipboard

Wrong Header names in webhook based trigger

Open the-csaba opened this issue 4 years ago • 4 comments

Bug Description

Same headers are renamed inside the bundle.rawRequest.headers , have an unexpected Http- prefix, which makes using it hard.

Also contrary to the documentation the bundle.cleanedRequest only contains the content, no header or method access.

Example headers
{
  'Http-Host': 'hooks.zapier.com',
  'Http-X-Request-Id': '26433038c459bbb396e829c60757bab1',
  'Http-X-Real-Ip': ';redacted;',
  'Http-X-Forwarded-For': ';redacted;',
  'Http-X-Forwarded-Host': 'hooks.zapier.com',
  'Http-X-Forwarded-Port': '443',
  'Http-X-Forwarded-Proto': 'https',
  'Http-X-Scheme': 'https',
  'Http-X-Original-Forwarded-For': '35.189.17.248',
  'Content-Length': '2972',
  'Http-Accept': '*/*',
  'Http-Accept-Encoding': 'deflate, gzip',
  'Content-Type': 'application/json',
  'Http-Referer': 'https://hooks.zapier.com/hooks/standard/4208012/bfea20d2a2c1451bbccd9a5dcfb3388d/',
  'Http-User-Agent': 'WooCommerce/4.7.0 Hookshot (WordPress/5.5.3)',
  'Http-X-Wc-Webhook-Delivery-Id': '2bc1695b2762fe98193866742c246b9b',
  'Http-X-Wc-Webhook-Event': 'updated',
  'Http-X-Wc-Webhook-Id': '2622',
  'Http-X-Wc-Webhook-Resource': 'order',
  'Http-X-Wc-Webhook-Signature': 'E8QTnfh3/VrBQMQQfE71fbtWI8nQZG47WPwN2bUygT8=',
  'Http-X-Wc-Webhook-Source': ':redacted:',
  'Http-X-Wc-Webhook-Topic': 'order.updated',
  'Http-X-Wordpress-Gmt-Offset': '8'
}

Reproduction Steps

  1. Setup a wenhook based trigger for example WooCommerce
  2. send data to the trigger
  3. inspect the bundle

Version Info

  • CLI version: 10.1.1
  • Node.js version: v12.19.0
  • OS info: darwin-x64
  • zapier-platform-core dependency: 10.1.1

the-csaba avatar Nov 17 '20 08:11 the-csaba