Fix automatic encryption

This commit is contained in:
Tyler 2018-01-27 18:21:57 -05:00
parent d37029ebe0
commit 4c4c009f1a
1 changed files with 7 additions and 1 deletions

View File

@ -108,8 +108,14 @@ func (p *Pastee) Submit(paste *Paste) (*PasteResponse, error) {
if paste.Encrypted {
key = RandStringBytesMaskImprSrc(32)
var err error
for _, section := range paste.Sections {
section.Contents = cryptojs.Encrypt(section.Contents, key)
section.Contents, err = cryptojs.Encrypt(section.Contents, key)
if err != nil {
return nil, err
}
}
}