-
Notifications
You must be signed in to change notification settings - Fork 26.6k
Description
Which @angular/* package(s) are the source of the bug?
common/http
Is this a regression?
Yes
Description
After update to angular14, a function in our project which use HttpClient.jsonp()
not work any more.
We finded out that HttpClient.jsonp
in v14 will throw an error if the headers in reqeust is not empty, and that what make matters worse is that in the project we import HttpClientModule which provides a HttpXsrfInterceptor before HttpClientJsonpModule, so before JsonpInterceptor
can handle the jsonp request, the request was already intercepted by HttpXsrfInterceptor
and a xsrf header was already added to the request which caused the 'JSONP requests do not support headers
' Error
I don't think is resonable that we must import HttpClientJsonpModule before HttpClientModule to use jsonp. May be HttpXsrfInterceptor should escape if request.method is jsonp
, i'd like to help if angular team agree with this.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
JSONP requests do not support headers
Please provide the environment you discovered this bug in (run ng version
)
angular v14
node v16
macos 12.5.1
Anything else?
No response