koajs / koa

Expressive middleware for node.js using ES2017 async functions
https://koajs.com
MIT License
35.2k stars 3.23k forks source link

Developer's responsibility to encode redirect URL? #1289

Closed bchociej closed 5 years ago

bchociej commented 5 years ago

Hi, from reading the code and previous issues I believe I have the right answer, but since it is not 100% clear I just wanted to make sure:

Is it the developer's (my) responsibility to call encodeURI/encodeURIComponent when passing a URL into ctx.redirect(url)? I assume so, but I'm unclear on whether this is done automatically at some stage.

Thanks in advance and thank you for a great open source project.

Runrioter commented 5 years ago

It is your responsibility and is not done automatically.

fl0w commented 5 years ago

I'm going to close this one as question has been answered. For future reference, https://github.com/koajs/koa/issues/1250