Do only follow HTTP and HTTPS redirects

Backport of #11032 to stable5
Merge pull request #11249 from owncloud/backport-11032-stable5

Do only follow HTTP and HTTPS redirects