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

docs(docs.nestjs.com) show example of enabling Throttle rate limiting… #2488

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

lukaszniemkiewicz
Copy link
Contributor

@lukaszniemkiewicz lukaszniemkiewicz commented Oct 4, 2022

show example of enabling Throttle rate limiting behind proxies with express

the documentation was unsufficient to succesfuly implement the throttling since the external link to express suggested using 'app.set' method, wich by default throws 'property set does not exist` error

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • [x ] Docs
  • Other... Please describe:

What is the current behavior?

documentation for rate limiting behind proxies is insufficient to implement the throttling, since the external link to express suggested using app.set('trust proxy', 'loopback') method, which in NestJs throws property set does not exist error

Issue Number: N/A

What is the new behavior?

To successfully apply app.set('trust proxy', 'loopback') one needs to modify main.ts as shown in the commit
specifically changeing: const app = await NestFactory.create<NestExpressApplication>(AppModule);

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

… behind proxies with express

the documentation was unsufficient to succesfuly implement the throttling since the external link
to express suggested using 'app.set' method,  wich by default  throws
'property set does not exist` error
@micalevisk
Copy link
Member

can you remove the .swp file

I guess this is a good time to add the following to .gitignore as well :)

# Vim
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]

Copy link
Member

@jmcdo29 jmcdo29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor grammar change, otherwise looks good

content/security/rate-limiting.md Outdated Show resolved Hide resolved
@kamilmysliwiec kamilmysliwiec merged commit d18f683 into nestjs:master Oct 18, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

4 participants