MCPcopy Create free account
hub / github.com/angular/angular / hasAuthHeaders

Function hasAuthHeaders

packages/common/http/src/transfer_cache.ts:345–351  ·  view source on GitHub ↗

@returns true when the request contains authentication or cookie headers.

(req: HttpRequest<unknown>)

Source from the content-addressed store, hash-verified

343
344/** @returns true when the request contains authentication or cookie headers. */
345function hasAuthHeaders(req: HttpRequest<unknown>): boolean {
346 const headers = req.headers;
347
348 return (
349 headers.has('authorization') || headers.has('proxy-authorization') || headers.has('cookie')
350 );
351}
352
353const UNCACHEABLE_CACHE_CONTROL_DIRECTIVES = new Set(['no-store', 'private', 'no-cache']);
354

Callers 1

canUseOrCacheRequestFunction · 0.85

Calls 1

hasMethod · 0.65

Tested by

no test coverage detected