Backport #3487 Basic Auth fix
Merge pull request #4346 from owncloud/basic_hack_auth_backport

Basic hack auth backport