Loading

HTTP/2 Header Case Normalization in Salesforce REST API (Cloudflare CDN Migration)

게시 일자: Jun 28, 2026
상세 설명

What Changed

Salesforce has migrated its content delivery infrastructure to Cloudflare's CDN (Content Delivery Network). As part of this migration, HTTP/2 protocol enforcement has been applied to all Salesforce API traffic. HTTP/2 requires that all HTTP header names be transmitted in lowercase.
Previously, HTTP headers in Salesforce API responses retained their original mixed-case formatting (for example, Content-Type, X-Salesforce-Request-Id). After the Cloudflare CDN migration, all HTTP header names are normalized to lowercase (for example, content-type, x-salesforce-request-id).

Why This Matters

Apex code, integration middleware, or custom applications that retrieve HTTP response headers by their original mixed-case names will fail to find the header after this change, because the header name lookup is case-sensitive in many HTTP client libraries.

Who Is Affected

This change affects:

  • Apex callouts that read HTTP response headers using HttpResponse.getHeader('Content-Type') or similar mixed-case header name patterns.
  • External integrations that parse Salesforce API response headers by name.
  • Any middleware or ETL tool that relies on exact header name casing from Salesforce REST API responses.
솔루션

Update Apex Code to Use Lowercase Header Names

To ensure your Apex code works correctly after the Cloudflare CDN migration, update all HttpResponse.getHeader() calls to use lowercase header names.
Before the migration, a typical Apex header retrieval looked like: String contentType = res.getHeader('Content-Type');
After the migration, update this to: String contentType = res.getHeader('content-type');

Migration-Safe Pattern

To write code that works correctly both before and after the migration (for example, if you are deploying to orgs that may or may not yet be migrated), implement a fallback pattern:

  1. First attempt to retrieve the header using the lowercase name: res.getHeader('content-type').
  2. If the result is null, fall back to the original mixed-case name: res.getHeader('Content-Type').
  3. Use whichever result is non-null.

This pattern ensures backward compatibility during the migration window.

Updating External Integrations

If you use an external tool or integration that reads Salesforce API response headers, review its HTTP client configuration and update any header name references to use lowercase values.

Knowledge 기사 번호

005318663

 
로드 중
Salesforce Help | Article