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

Function withXsrfConfiguration

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

Source from the content-addressed store, hash-verified

209 * @see {@link provideHttpClient}
210 */
211export function withXsrfConfiguration({
212 cookieName,
213 headerName,
214}: {
215 cookieName?: string;
216 headerName?: string;
217}): HttpFeature<HttpFeatureKind.CustomXsrfConfiguration> {
218 const providers: Provider[] = [];
219 if (cookieName !== undefined) {
220 providers.push({provide: XSRF_COOKIE_NAME, useValue: cookieName});
221 }
222 if (headerName !== undefined) {
223 providers.push({provide: XSRF_HEADER_NAME, useValue: headerName});
224 }
225
226 return makeHttpFeature(HttpFeatureKind.CustomXsrfConfiguration, providers);
227}
228
229/**
230 * 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