[Answered ]-Angular with https-proxy-agent only works with trailing / โ€“ what am I missing?

1๐Ÿ‘

โœ…

I solved it now.

I used django with Django REST framework as the backend, which uses urls with a trailing slash as the default. When I opened the page in the browser it worked without a slash as well, because I was automatically forwarded. That forward did not work over the proxy because the response sent from localhost:8000 has the location set to /endpoint/ which always resulted in the localhost:4200.

I fixed it by removing the trailing slash in the urls.py:

router = routers.DefaultRouter(trailing_slash=False)

In addition I had to deleted my browser data for some reason.

๐Ÿ‘คLennart Thamm

Leave a comment