Closed kartoch closed 10 years ago
I could force the method _send
to accept 301:
self._send('HEAD', remote_path, (200, 301, 404))
But I'm not sure if it is the right way / coherent with the webdav procotol.
I'm also unsure...
It seems the '301' case is managed by the ls
and mkdir
commands. Maybe factorize the code about this case then extends exists for it ?
usually redirection could be manage by requests. Why not put a switch to activate it globaly and/or for each function as optional parameter ? The programmer will choose if it is acceptable to redirect or not.
Well @kartoch, I'm not sure WebDAV 301 should actually be treated as a redirection. The protocol is a bit unclear to me, to be honest. I just change and fix stuff according to comments of developers who use this library.
So anyway, yes - we can just add this code to the expected codes I guess. I'm personally against turning on automatic redirections in requests because I'm not sure whether or not it makes sense. If you try that yourself and find that it works as expected, please let me know what you tested and how, and submit a pull request.
Added 301 to expected result of exists().
I've the following error stack:
The problem seems that the webdav server is returning a 301 when method
exists()
check for existing directory, and easywebdav is expecting a 200 or 404.