#3846: Added choice of wrapper into writeRedirectionCode