code: func (w *ResponseWriter) finish() {
  
  	// Determine if we should Base64 encode the output
  	contentType := w.response.Headers["Content-Type"]
  
  	// Only encode text content types without base64 encoding
  	w.response.IsBase64Encoded = !textContentTypesRegexp.MatchString(contentType)
  
  	if w.response.IsBase64Encoded {
  		w.response.Body = base64.StdEncoding.EncodeToString(w.output.Bytes())
  	} else {
  		w.response.Body = w.output.String()
  	}
  }
docs: // finish writes the accumulated output to the response.Body