def ContentLengthRewriter(response, request_headers, env_dict):
 if (env_dict and (env_dict.get('REQUEST_METHOD', '') == 'HEAD')):
  return
 if (response.status_code != httplib.NOT_MODIFIED):
  response.headers['Content-Length'] = str(_RemainingDataSize(response.body))
 elif ('Content-Length' in response.headers):
  del response.headers['Content-Length']

def ContentLengthRewriter ( response , request_headers , env_dict ) : if ( env_dict and ( env_dict . get ( 'REQUEST_METHOD' , '' ) == 'HEAD' ) ) : return if ( response . status_code != httplib . NOT_MODIFIED ) : response . headers [ 'Content-Length' ] = str ( _RemainingDataSize ( response . body ) ) elif ( 'Content-Length' in response . headers ) : del response . headers [ 'Content-Length' ]
rewrite the content-length header .