π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[server] Add collection check for public upload
Neeraj Guptad2c3dbfd06f4
diff --git a/server/pkg/api/public_collection.go b/server/pkg/api/public_collection.goindex 3cb56cb41a..d1d6da822e 100644--- a/server/pkg/api/public_collection.go+++ b/server/pkg/api/public_collection.go@@ -2,12 +2,13 @@ package apiimport ("fmt"+ "net/http"+ "strconv"+fileData "github.com/ente-io/museum/ente/filedata""github.com/ente-io/museum/pkg/controller/collections""github.com/ente-io/museum/pkg/controller/filedata""github.com/ente-io/museum/pkg/controller/public"- "net/http"- "strconv""github.com/ente-io/museum/pkg/controller/storagebonus"@@ -166,6 +167,11 @@ func (h *PublicCollectionHandler) CreateFile(c *gin.Context) {}enteApp := auth.GetApp(c)+ accessContext := auth.MustGetPublicAccessContext(c)+ if file.CollectionID != accessContext.CollectionID {+ handler.Error(c, stacktrace.Propagate(ente.NewBadRequestWithMessage("can only update to associated collection"), ""))+ return+ }fileRes, err := h.Controller.CreateFile(c, file, enteApp)if err != nil {