fix(WooCommerce): always expect signature in webhook requests (#28367)
diff --git a/erpnext/erpnext_integrations/connectors/woocommerce_connection.py b/erpnext/erpnext_integrations/connectors/woocommerce_connection.py
index f5f9ce3..9409485 100644
--- a/erpnext/erpnext_integrations/connectors/woocommerce_connection.py
+++ b/erpnext/erpnext_integrations/connectors/woocommerce_connection.py
@@ -19,8 +19,7 @@
)
if frappe.request.data and \
- frappe.get_request_header("X-Wc-Webhook-Signature") and \
- not sig == bytes(frappe.get_request_header("X-Wc-Webhook-Signature").encode()):
+ not sig == frappe.get_request_header("X-Wc-Webhook-Signature", "").encode():
frappe.throw(_("Unverified Webhook Data"))
frappe.set_user(woocommerce_settings.creation_user)