Skip to content

Implement Default for limit::ResponseBody#679

Merged
jlizen merged 1 commit into
tower-rs:mainfrom
muhamadazmy:pr679
May 19, 2026
Merged

Implement Default for limit::ResponseBody#679
jlizen merged 1 commit into
tower-rs:mainfrom
muhamadazmy:pr679

Conversation

@muhamadazmy
Copy link
Copy Markdown
Contributor

@muhamadazmy muhamadazmy commented May 18, 2026

Implement Default for limit::ResponseBody

Summary:
This adds a Default implementation to limit::ResponseBody if the wrapped
body also implements Default

This allows combining services as follows:

ServiceBudiler::new()
  .layer(CorsLayer::very_permissive())
  .layer(RequestBodyLimitLayer::new(limit))

Summary:
This adds a `Default` implementation to `limit::ResponseBody` if the wrapped
body also implements `Default`

This allows combining services as follows:

```
ServiceBudiler::new()
  .layer(CorsLayer::very_permissive())
  .layer(RequestBodyLimitLayer::new(limit)
```
Copy link
Copy Markdown
Member

@jlizen jlizen left a comment

Choose a reason for hiding this comment

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

Thanks!

@jlizen jlizen merged commit 514745c into tower-rs:main May 19, 2026
12 checks passed
@muhamadazmy muhamadazmy deleted the pr679 branch May 19, 2026 14:04
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.

2 participants