Skip to main content

Type Alias: CrossOriginHeadersCallback

CrossOriginHeadersCallback = (headerNames, hop) => string[]

Chooses the request headers sent to another origin (see AppUpdater.crossOriginHeaders): gets the lowercase names of the request headers about to be sent on hop (names only, no values) and returns the names of the ones to send (case-insensitive). Called for each request and redirect to another origin than the update feed, never for the feed's own origin, which gets every header.

Parameters​

headerNames​

string[]

hop​

CrossOriginHop

Returns​

string[]

Examples​

() => [] // none of them
(headerNames, hop) => (hop.to.origin === "https://cdn.example.com" ? headerNames.filter(it => it === "x-tenant") : [])