code: func (h *Handler) handleGetBackup(w http.ResponseWriter, req *http.Request, _ httprouter.Params) {
  	r, err := h.Process.Backup()
  	if err != nil {
  		httphelper.Error(w, err)
  		return
  	}
  	defer r.Close()
  
  	w.Header().Set("Trailer", backupChecksumTrailer)
  	w.WriteHeader(200)
  
  	hash := sha512.New()
  	if _, err := io.Copy(io.MultiWriter(w, hash), r); err != nil {
  		h.Logger.Error("error streaming backup", "err", err)
  		r.Close()
  		return
  	}
  
  	// Close the reader and confirm that it finished.
  	// Sets a trailer at the end of the HTTP response.
  	if err := r.Close(); err == nil {
  		// Temporary hack for writing trailers until Flynn uses Go 1.5.
  		w.(http.Flusher).Flush()
  		conn, buf, _ := w.(http.Hijacker).Hijack()
  		buf.WriteString("0\r\n") // eof
  		http.Header{backupChecksumTrailer: {hex.EncodeToString(hash.Sum(nil))}}.Write(buf)
  		buf.WriteString("\r\n") // end of trailers
  		buf.Flush()
  		conn.Close()
  	} else {
  		h.Logger.Error("error returned from backup", "err", err)
  	}
  }
docs: // handleGetBackup handles request to GET /backup.