MCPcopy Create free account
hub / github.com/apache/cloudstack / headersGetter

Function headersGetter

tools/ngui/static/js/lib/angular.js:8484–8496  ·  view source on GitHub ↗

* Returns a function that provides access to parsed headers. * * Headers are lazy parsed when first requested. * @see parseHeaders * * @param {(string|Object)} headers Headers to provide access to. * @returns {function(string=)} Returns a getter function which if called with: * * - if call

(headers)

Source from the content-addressed store, hash-verified

8482 * - if called with no arguments returns an object containing all headers.
8483 */
8484function headersGetter(headers) {
8485 var headersObj = isObject(headers) ? headers : undefined;
8486
8487 return function(name) {
8488 if (!headersObj) headersObj = parseHeaders(headers);
8489
8490 if (name) {
8491 return headersObj[lowercase(name)] || null;
8492 }
8493
8494 return headersObj;
8495 };
8496}
8497
8498
8499/**

Callers 2

$httpFunction · 0.85
resolvePromiseFunction · 0.85

Calls 3

isObjectFunction · 0.85
parseHeadersFunction · 0.85
lowercaseFunction · 0.85

Tested by

no test coverage detected