I think the request object can handle is fine, I think javascript is the problem. \n in javascript denotes a new line, so what I believe is happenning is that javascript is converting the value before it even makes it to the redirection. Since on a javascript redirect you can't have a line break, I think it is parsing it out so it can handle the redirect and not crash the browser.