1
0
mirror of https://github.com/lus/pasty.git synced 2023-08-10 21:13:09 +03:00

Fix file system driver ID listing

This commit is contained in:
Lukas Schulte Pelkum 2021-04-18 22:05:48 +02:00
parent 239ad901dd
commit 86522b63df
No known key found for this signature in database
GPG Key ID: 408DA7CA81DB885C

View File

@ -41,6 +41,11 @@ func (driver *FileDriver) ListIDs() ([]string, error) {
return err return err
} }
// Only count JSON files
if !strings.HasSuffix(info.Name(), ".json") {
return nil
}
// Decode the file name // Decode the file name
decoded, err := base64.StdEncoding.DecodeString(strings.TrimSuffix(info.Name(), ".json")) decoded, err := base64.StdEncoding.DecodeString(strings.TrimSuffix(info.Name(), ".json"))
if err != nil { if err != nil {