( req: HttpRequest<unknown>, next: HttpHandlerFn, )
| 300 | * Identifies requests with the method JSONP and shifts them to the `JsonpClientBackend`. |
| 301 | */ |
| 302 | export function jsonpInterceptorFn( |
| 303 | req: HttpRequest<unknown>, |
| 304 | next: HttpHandlerFn, |
| 305 | ): Observable<HttpEvent<unknown>> { |
| 306 | if (req.method === 'JSONP') { |
| 307 | return inject(JsonpClientBackend).handle(req as HttpRequest<never>); |
| 308 | } |
| 309 | |
| 310 | // Fall through for normal HTTP requests. |
| 311 | return next(req); |
| 312 | } |
| 313 | |
| 314 | /** |
| 315 | * Identifies requests with the method JSONP and |