-
Notifications
You must be signed in to change notification settings - Fork 101
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
Wsgi content length #1175
Merged
Merged
Wsgi content length #1175
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
icemac
approved these changes
Oct 18, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the approach especially the change in the zope.ini skel file documenting the usage.
dataflake
approved these changes
Oct 18, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the one test module name change
Michael Howitz wrote at 2023-10-17 23:07 -0700:
@icemac approved this pull request.
I like the approach especially the change in the zope.ini skel file documenting the usage.
On src/ZPublisher/tests/test_paste.py:
The module under test is called `pastefilter`, so I'd prefer the test module to be called `test_pastefilter`.
I have used the more general `test_paste` because initially
I wanted to test more of the WSGI related configuration.
e.g. `paste.deploy.loadapp` (applied to `Zope2.utilities:skel/zope.ini.in`).
As far as I know, there are not yet tests for this.
After the recognition that the WSGI middleware already used
by `Zope` (--> `httpexceptions`) has no filter definition
in `zope.ini` but is included in the pipeline via a direct `egg:` reference,
I decided to do the same with the new middleware component.
Its test therefore did not require a `zope.ini` reference
and I postponed other WSGI configuration tests.
Do you think that such tests would be beneficial?
Would `ZPublisher` be an appropriate place for such tests?
If you answer twice with "yes", I think `test_paste` could be retained
as container for future paste/WSGI configuration tests.
If you would put such tests elsewhere (they depend on `setup.py`
for `egg:` references and potentially `Zope2.utilities:skel`
for server, application tests),
I agree that `test_paste` should get renamed.
|
This was referenced Oct 18, 2023
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allows administrators to fix #1171.
The PR defines the new
paste.filter_app_factory
entry pointcontent_length
corresponding to a WSGI middleware component honoring aContent-Length
request header.Administrators can integrate this middleware into the WSGI pipeline when the used WSGI server does not honor the
Content-Length
request header. The WSGI spec recommends in note 1 of section Input and Error Streams that servers should honor theContent-Length
request header. Therefore, most servers will do and the middleware should rarely be necessary; but there are exceptions, e.g. Python'swsgiref.simple_server
.