| 310 | * @deprecated 22.1 JSONP is deprecated as it can cause XSS vulnerabilities. Use standard HTTP requests instead. Intent to remove in future versions of Angular. |
| 311 | */ |
| 312 | export function jsonpInterceptorFn( |
| 313 | req: HttpRequest<unknown>, |
| 314 | next: HttpHandlerFn, |
| 315 | ): Observable<HttpEvent<unknown>> { |
| 316 | if (req.method === 'JSONP') { |
| 317 | return inject(JsonpClientBackend).handle(req as HttpRequest<never>); |
| 318 | } |
| 319 | |
| 320 | // Fall through for normal HTTP requests. |
| 321 | return next(req); |
| 322 | } |
| 323 | |
| 324 | /** |
| 325 | * Identifies requests with the method JSONP and |