MCPcopy Index your code
hub / github.com/SignTools/SignTools / writeFileResponse

Function writeFileResponse

main.go:574–587  ·  view source on GitHub ↗
(c echo.Context, file io.ReadSeeker, app storage.App)

Source from the content-addressed store, hash-verified

572}
573
574func writeFileResponse(c echo.Context, file io.ReadSeeker, app storage.App) error {
575 name, err := app.GetString(storage.AppName)
576 if err != nil {
577 return err
578 }
579 //TODO: Should use the file's mod time, otherwise may tell client to use cached file even though it has changed
580 modTime, err := app.GetModTime()
581 if err != nil {
582 return err
583 }
584 c.Response().Header().Add("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"`, name))
585 http.ServeContent(c.Response(), c.Request(), name, modTime, file)
586 return nil
587}
588
589func uploadUnsignedApp(c echo.Context) error {
590 profileId := c.FormValue(formNames.FormProfileId)

Callers 3

getSignedAppFunction · 0.85
getUnsignedAppJobFunction · 0.85
getUnsignedAppFunction · 0.85

Calls 3

AddMethod · 0.80
GetStringMethod · 0.65
GetModTimeMethod · 0.65

Tested by

no test coverage detected