Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Adds a ContentLengthMiddleware for auto-injecting the Content-Length response header #45

Conversation

weierophinney
Copy link
Member

This feature is pulled from zend-diactoros' `SapiEmitterTrait::injectContentLength() method; a future version will omit that functionality, in favor of using this new middleware.

This middleware will inject a Content-Length response header based on the body size if:

  • no Content-Length header is already present AND
  • the body size is non-null

Otherwise, it returns the response verbatim.

@weierophinney weierophinney added this to the 4.1.0 milestone Sep 11, 2017
…response header

This feature is pulled from zend-diactoros'
`SapiEmitterTrait::injectContentLength() method; a future version will
omit that functionality, in favor of using this new middleware.

This middleware will inject a `Content-Length` response header based on
the body size if:

- no `Content-Length` header is already present AND
- the body size is non-null

Otherwise, it returns the response verbatim.
@weierophinney weierophinney force-pushed the feature/content-length-middleware branch from 218de34 to 330e9f1 Compare September 11, 2017 16:29
@weierophinney weierophinney merged commit e0dd647 into zendframework:develop Sep 11, 2017
weierophinney added a commit that referenced this pull request Sep 11, 2017
@weierophinney weierophinney deleted the feature/content-length-middleware branch September 11, 2017 16:46
weierophinney added a commit to weierophinney/zend-expressive that referenced this pull request Sep 11, 2017
weierophinney added a commit to zendframework/zend-expressive that referenced this pull request Sep 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant