First I hope it's the good way to do it.
As pointed briefly in this quote :
there is still a problem with some servers that don't return their content-type encoding.
For example, one I'm trying to connect is returning 'Content-Type' => 'text/xml' and Moodle says "Missing Content-Type: text/xml header in response!!" in debug mode.
in lib/webdavlib.php:812 , I have surrounded the part with charset=xxx with ()? and then it worked.
There is others tests about charset l.623 and l.720 in the same file.
My knowledge stops here, is it a problem to avoid charset tests ? I think not.