dojo / core

:rocket: Dojo 2 - language helpers and utilities.
http://dojo.io
Other
213 stars 62 forks source link

Minor Feature Request : core/request : store redirected URLs #284

Open sebilasse opened 7 years ago

sebilasse commented 7 years ago

It could be useful to store all redirecting URLs in an array e. g. in the options object. The options are returned with the response and the user now knows the URLs "in between" request and response.

kitsonk commented 7 years ago

It is worth investigating, in that browser caches are likely handling this automatically when a 301 or a 302 is provided. It might be totally unnecessary.

sebilasse commented 7 years ago

Well, it is not about handling. It is more about knowing. For example Web-Sign In solutions like RelMeAuth or IndieAuth : It would be useful to say until the end of the session that all these URLs redirect to target X.

kitsonk commented 7 years ago

That really feels like a higher order application concern. If you are in possession of a token that means you are logged in, then remapping a load of URLs is something an application can do. Worst case, the approach would be some sort of request provider that is then registered as the default provider (or even a particular set of URLs) with something like:

import { providerRegistry } from '@dojo/core/request';

providerRegistry.register(/some.sort.of.test/, myAwesomeProvider, true);