chore: code clean (#516)

This commit is contained in:
boojack
2022-11-21 23:23:05 +08:00
committed by GitHub
parent 0d0f893b93
commit 013ded1e04
4 changed files with 7 additions and 6 deletions

View File

@@ -262,11 +262,10 @@ func (s *Server) registerResourcePublicRoutes(g *echo.Group) {
c.Response().Writer.WriteHeader(http.StatusOK)
c.Response().Writer.Header().Set("Content-Type", resource.Type)
c.Response().Header().Set(echo.HeaderCacheControl, "max-age=31536000, immutable")
c.Response().Writer.Header().Set(echo.HeaderCacheControl, "max-age=31536000, immutable")
if _, err := c.Response().Writer.Write(resource.Blob); err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to write response").SetInternal(err)
}
return nil
})
}