[PR #94] [CLOSED] Enforce paste content size limit #160

Closed
opened 2026-02-27 10:15:59 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/matze/wastebin/pull/94
Author: @cgzones
Created: 1/18/2025
Status: Closed

Base: masterHead: body_length


📝 Commits (1)

  • 23e7189 Enforce paste content size limit

📊 Changes

4 files changed (+29 additions, -7 deletions)

View changed files

📝 src/errors.rs (+6 -0)
📝 src/main.rs (+2 -0)
📝 src/routes/paste.rs (+20 -7)
📝 src/test_helpers.rs (+1 -0)

📄 Description

Since commit 7cd3924c ("Use ServiceBuilder to layer middleware") the request body size is no longer enforced via the WASTEBIN_MAX_BODY_SIZE environment variable.

Reintroduce that enforcement.

Also tweak error propagation in the insert() handler to show nice formatted error sites instead of blank pages.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/matze/wastebin/pull/94 **Author:** [@cgzones](https://github.com/cgzones) **Created:** 1/18/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `body_length` --- ### 📝 Commits (1) - [`23e7189`](https://github.com/matze/wastebin/commit/23e71895f6681734b7761da7fcb6654cc5afb9e9) Enforce paste content size limit ### 📊 Changes **4 files changed** (+29 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/errors.rs` (+6 -0) 📝 `src/main.rs` (+2 -0) 📝 `src/routes/paste.rs` (+20 -7) 📝 `src/test_helpers.rs` (+1 -0) </details> ### 📄 Description Since commit 7cd3924c ("Use ServiceBuilder to layer middleware") the request body size is no longer enforced via the WASTEBIN_MAX_BODY_SIZE environment variable. Reintroduce that enforcement. Also tweak error propagation in the insert() handler to show nice formatted error sites instead of blank pages. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 10:15:59 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/wastebin-matze#160
No description provided.