diff --git a/internal/app/handlers.go b/internal/app/handlers.go index 4773eb96..f03623d8 100644 --- a/internal/app/handlers.go +++ b/internal/app/handlers.go @@ -892,19 +892,14 @@ func (app *App) blobStorageWrite(c *gin.Context) { hash := c.GetHeader(common.CRC32CHashHeader) log.Debugf("TODO: check/save etc. write file '%s', hash '%s'", fileName, hash) - newgeneration, err := app.blobStorer.StoreBlob(uid, blobID, c.Request.Body, 0) + _, err := app.blobStorer.StoreBlob(uid, blobID, c.Request.Body, 0) if err != nil { log.Error(err) c.AbortWithStatus(http.StatusInternalServerError) return } - //not checked by the client yet, but who knows - crcJSON(c, http.StatusOK, messages.SyncRootV4Response{ - Generation: newgeneration, - Hash: string(blobID), - SchemaVersion: SchemaVersion, - }) + c.Status(http.StatusOK) } func (app *App) integrationsGetMetadata(c *gin.Context) { diff --git a/internal/email/smtp.go b/internal/email/smtp.go index 4d69b00f..6e3be96c 100644 --- a/internal/email/smtp.go +++ b/internal/email/smtp.go @@ -13,6 +13,7 @@ import ( "net/url" "path/filepath" "strings" + "time" log "github.com/sirupsen/logrus" ) @@ -184,6 +185,7 @@ func (b *Builder) Send(cfg *SMTPConfig) (err error) { msgBuilder := strings.Builder{} //basic email headers + msgBuilder.WriteString(fmt.Sprintf("Date: %s\r\n", time.Now().Format(time.RFC1123Z))) msgBuilder.WriteString(fmt.Sprintf("From: %s\r\n", utf8encode(b.From.String()))) msgBuilder.WriteString(fmt.Sprintf("To: %s\r\n", utf8encode(to))) if b.ReplyTo != nil { diff --git a/internal/storage/fs/app.go b/internal/storage/fs/app.go index 7379063e..739ad09f 100644 --- a/internal/storage/fs/app.go +++ b/internal/storage/fs/app.go @@ -144,10 +144,12 @@ func (app *App) downloadBlob(c *gin.Context) { if scope != ReadScope { c.AbortWithStatus(http.StatusForbidden) + return } if blobID == "" { c.AbortWithStatus(http.StatusBadRequest) + return } log.Info("Requestng blob: ", blobID) @@ -185,16 +187,19 @@ func (app *App) uploadBlob(c *gin.Context) { err := VerifyURLParams([]string{uid, blobID, exp, scope}, exp, signature, app.cfg.JWTSecretKey) if err != nil { c.AbortWithStatus(http.StatusForbidden) + return } log.Info(exp, signature) if blobID == "" { c.AbortWithStatus(http.StatusBadRequest) + return } if scope != WriteScope { log.Warn("wrong scope: " + scope) c.AbortWithStatus(http.StatusForbidden) + return } body := c.Request.Body