Do only follow HTTP and HTTPS redirects

Backport of https://github.com/owncloud/core/pull/11032 to stable6