MCPcopy
hub / github.com/ionic-team/capacitor / normalizeHttpHeaders

Function normalizeHttpHeaders

core/src/core-plugins.ts:306–314  ·  view source on GitHub ↗
(headers: HttpHeaders = {})

Source from the content-addressed store, hash-verified

304 * @param headers The HttpHeaders object to normalize
305 */
306const normalizeHttpHeaders = (headers: HttpHeaders = {}): HttpHeaders => {
307 const originalKeys = Object.keys(headers);
308 const loweredKeys = Object.keys(headers).map((k) => k.toLocaleLowerCase());
309 const normalized = loweredKeys.reduce<HttpHeaders>((acc, key, index) => {
310 acc[key] = headers[originalKeys[index]];
311 return acc;
312 }, {});
313 return normalized;
314};
315
316/**
317 * Builds a string of url parameters that

Callers 1

buildRequestInitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected