Backport of #25046 to stable9.
Please note that I had to remove one block from the conflict because we don't hate the "X-Requested-With" logic at all in OC 9.0.
Please review @DeepDiver1975 @SergioBertolinSG
I've cherry-picked the automated test from #26712 here
@PVince81, thanks for your PR! By analyzing the history of the files in this pull request, we identified @icewind1991, @SergioBertolinSG and @LukasReschke to be potential reviewers.
I retested fed shares in both directions and they still work.
error: index-pack died of signal 15
11:07:42 fatal: index-pack failed
Use the correct realm for basic authentication - fixes #23427
Add test for duplicate 401 headers on DAV
@DeepDiver1975 review ? It's your fix that I backported
unused - see 36