Fix automatic encryption
This commit is contained in:
parent
d37029ebe0
commit
4c4c009f1a
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue