| 332 | */ |
| 333 | @Injectable() |
| 334 | export class JsonpInterceptor { |
| 335 | constructor(private injector: EnvironmentInjector) {} |
| 336 | |
| 337 | /** |
| 338 | * Identifies and handles a given JSONP request. |
| 339 | * @param initialRequest The outgoing request object to handle. |
| 340 | * @param next The next interceptor in the chain, or the backend |
| 341 | * if no interceptors remain in the chain. |
| 342 | * @returns An observable of the event stream. |
| 343 | */ |
| 344 | intercept(initialRequest: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { |
| 345 | return runInInjectionContext(this.injector, () => |
| 346 | jsonpInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)), |
| 347 | ); |
| 348 | } |
| 349 | } |
nothing calls this directly
no outgoing calls
no test coverage detected