TestNew/allows small body | Tests that bodies under the limit are accepted | Returns 200 OK and the full body content |
TestNew/rejects large body by content-length | Tests Content-Length header validation | Returns 413 Request Entity Too Large when Content-Length exceeds limit |
TestNew/rejects large body during read | Tests enforcement during body reading when Content-Length is unknown (-1) | Returns error during body read operation |
TestWithHandler | Tests custom error handler functionality | Calls custom error handler and returns JSON error response with 413 status |
TestWithOptions_Default | Tests default 1MB limit when no limit is specified | Accepts 512KB body with default configuration |
TestHelpers/KB | Tests KB helper function with various inputs | Correctly converts KB to bytes (1KB = 1024, 10KB = 10240) |
TestHelpers/MB | Tests MB helper function with various inputs | Correctly converts MB to bytes (1MB = 1048576, 5MB = 5242880) |
TestHelpers/GB | Tests GB helper function with various inputs | Correctly converts GB to bytes (1GB = 1073741824, 2GB = 2147483648) |
TestNew_WithHelpers/allows under limit | Tests helper functions integrated with New() for bodies under limit | Accepts 5KB body with 10KB limit |
TestNew_WithHelpers/rejects over limit | Tests helper functions integrated with New() for bodies over limit | Rejects 15KB body with 10KB limit, returns 413 |