()
| 177 | * @see {@link provideHttpClient} |
| 178 | */ |
| 179 | export function withInterceptorsFromDi(): HttpFeature<HttpFeatureKind.LegacyInterceptors> { |
| 180 | // Note: the legacy interceptor function is provided here via an intermediate token |
| 181 | // (`LEGACY_INTERCEPTOR_FN`), using a pattern which guarantees that if these providers are |
| 182 | // included multiple times, all of the multi-provider entries will have the same instance of the |
| 183 | // interceptor function. That way, the `HttpINterceptorHandler` will dedup them and legacy |
| 184 | // interceptors will not run multiple times. |
| 185 | return makeHttpFeature(HttpFeatureKind.LegacyInterceptors, [ |
| 186 | { |
| 187 | provide: LEGACY_INTERCEPTOR_FN, |
| 188 | useFactory: legacyInterceptorFnFactory, |
| 189 | }, |
| 190 | { |
| 191 | provide: HTTP_INTERCEPTOR_FNS, |
| 192 | useExisting: LEGACY_INTERCEPTOR_FN, |
| 193 | multi: true, |
| 194 | }, |
| 195 | ]); |
| 196 | } |
| 197 | |
| 198 | /** |
| 199 | * Customizes the XSRF protection for the configuration of the current `HttpClient` instance. |
no test coverage detected
searching dependent graphs…