Hi there ­čĹő­čĆ╗

Today I solved interesting problem and I want to share the solution. I was sending HTTP request to API with authorization token but API was always returning ÔÇť401, Token Not FoundÔÇŁ error. When I check the server logs, I found out that the token was really not sent. ItÔÇÖs really interesting. I searched for a while and found this interesting comment on Github.


I was sending my request to /api/locations endpoint but endpoint was /api/locations/ with slash. Server was responding with 301 redirect to /api/locations/. After the redirect, Swift doesnÔÇÖt send authorization header because of some security reasons. Thus, my server canÔÇÖt find my JWT token and always return 401.

I hope this will help you. Have a nice day ­čśŐ


Web geli┼čtirici, Youtuber, Blogger.

Write A Comment