({
cookieName,
headerName,
}: {
cookieName?: string;
headerName?: string;
})
| 209 | * @see {@link provideHttpClient} |
| 210 | */ |
| 211 | export 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. |
no test coverage detected