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

politeiad: Cleanup middleware. #1507

Merged
merged 4 commits into from Sep 21, 2021
Merged

politeiad: Cleanup middleware. #1507

merged 4 commits into from Sep 21, 2021

Conversation

lukebp
Copy link
Member

@lukebp lukebp commented Sep 17, 2021

This diff makes the following changes to politeiad:

  • Cleans up the existing middleware. Instead of registering middleware
    on individual routes, the middleware is now registered on the router
    itself.
  • Adds new middleware for a maximum request body size.
  • Adds tests to verify the request body size middleware.
  • Adds a config options to make the maximum request body size
    configurable.

This diff cleans up the politeiad middleware. It applies the middleware
on the router itself, instead of on individual routes, and also adds in
new middleware for a maximum request body size.
Copy link
Member

@chappjc chappjc left a comment

Choose a reason for hiding this comment

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

Good stuff. I just noticed that setupBackendGit doesn't use it's input arg, but that's tangential to this work.

@lukebp
Copy link
Member Author

lukebp commented Sep 17, 2021

I just noticed that setupBackendGit doesn't use it's input arg, but that's tangential to this work.

whoops, good catch. I'll fix that.

This diff makes the following changes to politeiad:

- Cleans up the existing middleware. Instead of registering middleware
  on individual routes, the middleware is now registered on the router
  itself.
- Adds new middleware for a maximum request body size.
- Adds tests to verify the request body size middleware.
- Adds a config options to make the maximum request body size
  configurable.
@lukebp lukebp changed the title politeiad: Clean up middleware. politeiad: Cleanup middleware. Sep 20, 2021
@lukebp lukebp merged commit 8c944a7 into decred:master Sep 21, 2021
@lukebp lukebp deleted the pd-middleware branch February 6, 2022 17:11
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.

None yet

3 participants