vanstyn / RapidApp

Turnkey ajaxy webapps
http://rapi.io
Other
48 stars 15 forks source link

AutoPanel (tabs) support for Redirects #65

Open vanstyn opened 10 years ago

vanstyn commented 10 years ago

The AutoPanel Ajax load should be able to automatically handle HTTP Redirects:

The management of the browser history is what makes this task more complicated. Currently there is a one-to-one association of hashnav path to tab, and what needs to be done is make it so that a given tab can be associated with multiple hashnav URLs, while handing all the possible edge-cases to keep the RESTful navigation system working predictably and reliably.

vanstyn commented 10 years ago

Suck.

It seems that the built-in JavaScript XMLHttpRequest object is hard-coded to transparently follow redirects and there is no way to stop it, or even see that it happened:

vanstyn commented 10 years ago

I had wanted to do this is pure javascript, but that doesn't look like it is doable because there doesn't appear to be a way to know if a redirect happened. This means the solution will have to involve the server-side one way or another. One approach might be to configure configure the server to return the uri requested in a response header, and then in javascript check to see if it matches, and if it doesn't it probably means a redirect occurred (since, amazingly the client isn't able to know the uri of its own request)... Will need to think about this...

deven commented 3 years ago

https://stackoverflow.com/a/54570164/1003451