rails / request.js

MIT License
389 stars 28 forks source link

Allow redirect value to be configurable #25

Closed t27duck closed 3 years ago

t27duck commented 3 years ago

While rare, there may be a case when the developer wishes to manually handle a redirected response.

The fetch api defines three values for the redirect option, "follow" (what request.js currently sets), "manual", and "error".

This change allows redirect to be passed as one of the options and will set the redirect option on the reqeust object. If not set, it will default to "follow" which is what the library currently does.