falconry / falcon

The no-magic web data plane API and microservices framework for Python developers, with a focus on reliability, correctness, and performance at scale.
https://falcon.readthedocs.io/en/stable/
Apache License 2.0
9.51k stars 937 forks source link

feat (status_codes): update HTTP status constants wrt RFC 9110 #2330

Closed prathik2401 closed 4 days ago

prathik2401 commented 2 weeks ago

refactor(response): replace falcon.HTTPPayloadTooLarge with falcon.HTTPContentTooLarge

Closes #2276

Summary of Changes

Replace the usage of falcon.HTTPPayloadTooLarge with falcon.HTTPContentTooLarge in the codebase. This change aligns with the recent renaming of the class in the Falcon library. The new class name better reflects the purpose of the error, which is to indicate that the content of the request is too large for the server to process.

Related Issues

2276

Pull Request Checklist

This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once; it will save you a few review cycles!

If an item doesn't apply to your pull request, check it anyway to make it apparent that there's nothing to do.

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

PR template inspired by the attrs project.

CaselIT commented 2 weeks ago

Can you add a newsfragment? It could read something similar to the 2.0 changelog line

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (f843b4f) to head (769f0f8). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2330 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 63 63 Lines 7545 7553 +8 Branches 1238 1239 +1 ========================================= + Hits 7545 7553 +8 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

vytas7 commented 4 days ago

not sere if we want to add module __getattr__ in the init to import HTTP_REQUEST_ENTITY_TOO_LARGE on demand and give a warning.

same in status? (maybe the warning could just be in status module __getattr__, the init one just imports it)

No, I think we're good wrt HTTP_REQUEST_ENTITY_TOO_LARGE since Falcon 4.0 is a major release, and this constant belongs to an even older iteration, it should have been removed long ago. The previous one is HTTP_PAYLOAD_TOO_LARGE.