Pretty sure it has worked at some point, but that PR probably has been rebased to pieces. This refactors the fix by @dannys42 into a method, as this URL fix is applied several places. Fixes #1114