Fix automatic encryption
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user