Skip to content

Obtaining Response Content Length & IP+Port within middleware? #2983

Answered by robjtede
rickmartensnl asked this question in Q&A
Discussion options

You must be logged in to vote
  1. Yes, see the Logger middleware for an example. In the general case, you'll need to read the entire payload stream to know for sure; you can't rely on there being a Content-Length header or even the Payload size_hint for this.
  2. Yes, through HttpRequest::app_config() method (admittedly with lack-luster docs).

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@rickmartensnl
Comment options

@robjtede
Comment options

@rickmartensnl
Comment options

@robjtede
Comment options

Answer selected by rickmartensnl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants