func (h *proxyHandler) GETZip(w http.ResponseWriter, r *http.Request) {
	ctx := r.Context()
	path, ver := parsePathVersion(r)

	mod, err := h.uc.LoadModule(ctx, path)
	if err != nil {
		respondError(w, statusCode(err), err)
		return
	}
	if !mod.HasVersion(ver) {
		respondError(w, statusCode(domain.ErrNotFound), fmt.Errorf("%w: \"%s\": unknown revision %s", domain.ErrNotFound, path, ver))
		return
	}

	var buf bytes.Buffer
	err = h.uc.ZipModule(ctx, mod, ver, &buf)
	if err != nil {
		respondError(w, statusCode(err), err)
		return
	}

	_, err = buf.WriteTo(w)
	if err != nil {
		respondError(w, statusCode(err), err)
		return
	}
}
// GETZip handles module zip file queries.
GETZip handles module zip file queries.
// GETZip handles module zip file queries .
func (h *proxyHandler) GETZip(w http.ResponseWriter, r *http.Request) {
	ctx := r.Context()
	path, ver := parsePathVersion(r)
	mod, err := h.uc.LoadModule(ctx, path)
	if err != nil {
		respondError(w, statusCode(err), err)
		return
	}
	if !mod.HasVersion(ver) {
		respondError(w, statusCode(domain.ErrNotFound), fmt.Errorf("%w: \"%s\": unknown revision %s", domain.ErrNotFound, path, ver))
		return
	}
	var buf bytes.Buffer
	err = h.uc.ZipModule(ctx, mod, ver, &buf)
	if err != nil {
		respondError(w, statusCode(err), err)
		return
	}
	_, err = buf.WriteTo(w)
	if err != nil {
		respondError(w, statusCode(err), err)
		return
	}
}
func ( h * proxyHandler ) GETZip ( w http . ResponseWriter , r * http . Request ) { ctx := r . Context ( ) path , ver := parsePathVersion ( r ) mod , err := h . uc . LoadModule ( ctx , path ) if err != nil { respondError ( w , statusCode ( err ) , err ) return } if ! mod . HasVersion ( ver ) { respondError ( w , statusCode ( domain . ErrNotFound ) , fmt . Errorf ( " \" \" " , domain . ErrNotFound , path , ver ) ) return } var buf bytes . Buffer err = h . uc . ZipModule ( ctx , mod , ver , & buf ) if err != nil { respondError ( w , statusCode ( err ) , err ) return } _ , err = buf . WriteTo ( w ) if err != nil { respondError ( w , statusCode ( err ) , err ) return } }
GETZip handles module zip file queries.
GETZip handles module zip file queries .