This is a known issue, a solution is offered by official documentation:
https://docs.nextcloud.com/server/15/user_manual/files/access_webdav.html#id8
Codewise, there isn't much to be done at the moment. However, it might be useful to include some help file with Nextcloud installs to inform users of this workaround.