| 321 | */ |
| 322 | @Injectable() |
| 323 | export class JsonpInterceptor { |
| 324 | constructor(private injector: EnvironmentInjector) {} |
| 325 | |
| 326 | /** |
| 327 | * Identifies and handles a given JSONP request. |
| 328 | * @param initialRequest The outgoing request object to handle. |
| 329 | * @param next The next interceptor in the chain, or the backend |
| 330 | * if no interceptors remain in the chain. |
| 331 | * @returns An observable of the event stream. |
| 332 | */ |
| 333 | intercept(initialRequest: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { |
| 334 | return runInInjectionContext(this.injector, () => |
| 335 | jsonpInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)), |
| 336 | ); |
| 337 | } |
| 338 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…