MCPcopy
hub / github.com/angular/angular / withXsrfConfiguration

Function withXsrfConfiguration

packages/common/http/src/provider.ts:205–221  ·  view source on GitHub ↗
({
  cookieName,
  headerName,
}: {
  cookieName?: string;
  headerName?: string;
})

Source from the content-addressed store, hash-verified

203 * @see {@link provideHttpClient}
204 */
205export function withXsrfConfiguration({
206 cookieName,
207 headerName,
208}: {
209 cookieName?: string;
210 headerName?: string;
211}): HttpFeature<HttpFeatureKind.CustomXsrfConfiguration> {
212 const providers: Provider[] = [];
213 if (cookieName !== undefined) {
214 providers.push({provide: XSRF_COOKIE_NAME, useValue: cookieName});
215 }
216 if (headerName !== undefined) {
217 providers.push({provide: XSRF_HEADER_NAME, useValue: headerName});
218 }
219
220 return makeHttpFeature(HttpFeatureKind.CustomXsrfConfiguration, providers);
221}
222
223/**
224 * Disables XSRF protection in the configuration of the current `HttpClient` instance.

Callers 3

provider_spec.tsFile · 0.90
module.tsFile · 0.90
withOptionsMethod · 0.90

Calls 2

makeHttpFeatureFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…