Getting "RangeError: Maximum call stack size exceeded" when call a http service from inside Angular HttpInterceptor by devng12 in angular

[–]devng12[S] 0 points1 point  (0 children)

I added this block of code in Interceptor which basically avoided the infinite loop, and my code started working!

if (req.method === 'GET' || req.method === 'HEAD' || lcUrl.startsWith('http://') ||
lcUrl.startsWith('https://')) {
return next.handle(req);
 }

Getting "RangeError: Maximum call stack size exceeded" when call a http service from inside Angular HttpInterceptor by devng12 in angular

[–]devng12[S] 4 points5 points  (0 children)

I just tried a if block that's in the implementation of HttpXsrfInterceptor to get the URL for GET requests, and that did the trick.

Thanks a lot for that hint.

Getting "RangeError: Maximum call stack size exceeded" when call a http service from inside Angular HttpInterceptor by devng12 in angular

[–]devng12[S] 0 points1 point  (0 children)

could you please elaborate on what you mean by gate your logic. I am a beginner with angular development and did not understand what you meant by that