You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2019/07/02 16:30:29 UTC

[GitHub] [trafficcontrol] rob05c commented on issue #3567: New fakeOrigin testing tool

rob05c commented on issue #3567: New fakeOrigin testing tool
URL: https://github.com/apache/trafficcontrol/pull/3567#issuecomment-507751812
 
 
   >still not clear on the purpose of a BodyInterceptor
   
   It allows the HTTP handling code to defer writing the status code, headers, and body until after the real wrapped handler returned, but still let the real Handler be a standard `http.HandlerFunc`.
   
   For example, here it's being used to add a header after the "real" handler has written everything (which wouldn't normally be possible, because headers must be written before the body):
   
   https://github.com/apache/trafficcontrol/pull/3567/files#diff-414b9bb76c9e75065ecc98b9d0470b07R137
   
   And here it's being used to get the size of the body written, to log it:
   https://github.com/apache/trafficcontrol/pull/3567/files#diff-414b9bb76c9e75065ecc98b9d0470b07R109

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services