getdave / fetch-pjax

[BETA] Enables PJAX (PushState + Ajax) style navigation with the native Fetch API
Other
11 stars 1 forks source link

How to achieve redirections? #1

Open Shifrin opened 4 years ago

Shifrin commented 4 years ago

Thank you for the great library. I have started to give a try to this. It's working well and really fasts. But the problem which I found is I couldn't make a redirection anyway if server-side returns a redirection URL. Can you please give me an idea of how I can make a redirection or if I miss something please give your advice.

getdave commented 4 years ago

Ah. That might be an oversight.

You might need to alter the code to check for 301 or 302 response and let them fall through to be handled by the browser rather than intercepted by the JS.