({
cookieName,
headerName,
}: {
cookieName?: string;
headerName?: string;
})
| 203 | * @see {@link provideHttpClient} |
| 204 | */ |
| 205 | export 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. |
no test coverage detected
searching dependent graphs…