You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are receiving a 302 redirect from a webdav server to another domain and axios does not (for good reasons) automatically pass the Authorization header to the redirect url.
Normally we'd disable axios from following the redirect. We could just make the specific get file/stream request using axios direct but for consistency was hoping to keep using webdav-client.
Hi @nick-gray - What would suggest here? Would adding support for a redirectsEnabled kind of flag suffice? We could set maxRedirects to 0 under the hood by default, or something, and then allow it to be changed.
But then again, seeing as auth is dropped upon any redirect, maybe we should just disable it entirely.
I'd accept a PR for the latter (it's just a property update in the axios config).
We just changed to raw axios for the retrieval of content (the only step which gave the redirect). Our code checks for a 302 and if so do the request again with the same auth header if it was a redirect domain we trust.
redirectsEnabled flag would work so long as webdav-client can share the 302 we can make another request. For backwards compatibility and flexibility its probably easier just to expose maxRedirects (or all of the axios options? :) ) so we can by choice disable redirects (in case someone has non-authenticated webdav's they are using)
We are receiving a 302 redirect from a webdav server to another domain and axios does not (for good reasons) automatically pass the Authorization header to the redirect url.
Normally we'd disable axios from following the redirect. We could just make the specific get file/stream request using axios direct but for consistency was hoping to keep using webdav-client.
Any suggestions?
PS: this library is awesome @perry-mitchell!!
The text was updated successfully, but these errors were encountered: