Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable a configuration parameter to restrict URL length #526

Open
ghost opened this issue Jun 9, 2020 · 0 comments
Open

Enable a configuration parameter to restrict URL length #526

ghost opened this issue Jun 9, 2020 · 0 comments

Comments

@ghost
Copy link

ghost commented Jun 9, 2020

node.js version: v12.14.1

npm/yarn and version: 6.14.5

koa-router version: 9.0.1

koa version: 2.12.0

Code sample:

router.get('/', async (ctx, next) => {
    //Being able to restrict the max length of URL invoked to prevent attacks
   const reallyBigURL = `${ctx.protocol}://${ctx.host}/${ctx.url}`;
   console.log(reallyBigURL.length);
}

Expected Behavior:

To be able to restrict when initializing router instance or per route, the max length of the full URL (including protocol, host & URL)

Actual Behavior:

I can't find an option in the documentation to restrict max URL length

Additional steps, HTTP request details, or to reproduce the behavior or a test case:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants