HCP Gateway & WAF Reference
When to use this page
Looking up why a specific request got blocked by the HCP Gateway's Azure WAF, and the exact remediation. For the registration/authentication walkthrough, see HCP API Gateway.
HCP Gateway & WAF: What to Watch Forβ
The HCP Gateway uses Azure Web Application Firewall (WAF) to protect your APIs. Some requests may be blocked if they don't follow best practices.
| Scenario | Impact | How to Fix |
|---|---|---|
| URLs in POST body not encoded | Request blocked | Percent-encode all URLs in POST bodies |
GET with Transfer-Encoding header | Request blocked | Never send this header on GET |
Missing Accept header | Request blocked | Always send Accept on GET |
| Other WAF triggers | Request blocked | See best practices below |
Common WAF Block Scenariosβ
1. URLs in POST Body (Encoding Required)
Example fields:
config.privacypolicyurlappearance.font.fontSources.cssSrcappearance.merchantlogo
Remediation: Always percent-encode URLs in POST request bodies.
2. GET Requests with Transfer-Encoding Header
Including this header on GET requests will trigger the WAF and block the request.
Remediation: Never include Transfer-Encoding on GET requests.
3. Missing Accept Header
Azure WAF blocks GET requests that do not include an Accept header. This affects endpoints like:
/token/setup-payment-methods/sessions/payments/{payment_id}/customers/{customer_id}/payment-methods/payment-methods/search
Remediation: Always include an Accept header on GET requests.
4. Other Best Practices
- GET or HEAD requests should not have a body
- POST requests must have a valid JSON body
- Avoid SQL characters in request bodies
- Encode all URLs in request bodies