My project need to create directories on webdav server and the createDirectory do not work with recursive option because of the CORS preflight request.
For example, a recursive call to create a path /a/b/c, multiple stat requests are made to defect if the directory /a and /a/b are exists.
The library send out the request with the path /a instead of /a/ which caused webdav server responses 301 Moved Permanently, it is expected behavior regarding the MDN doc (https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSExternalRedirectNotAllowed).
Is it make sense to fix the createDirectory API call by add the ending slash to the stat request to avoid the CORS error?
My project need to create directories on webdav server and the
createDirectorydo not work withrecursiveoption because of the CORS preflight request.For example, a recursive call to create a path
/a/b/c, multiplestatrequests are made to defect if the directory/aand/a/bare exists.The library send out the request with the path
/ainstead of/a/which caused webdav server responses301 Moved Permanently, it is expected behavior regarding the MDN doc (https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSExternalRedirectNotAllowed).Is it make sense to fix the
createDirectoryAPI call by add the ending slash to thestatrequest to avoid the CORS error?