mirror of
https://github.com/vbatts/imgsrv.git
synced 2024-12-24 23:06:31 +00:00
fixing the regex find for extensions
This commit is contained in:
parent
d4824ad6a2
commit
6e439b0de4
1 changed files with 2 additions and 2 deletions
|
@ -569,9 +569,9 @@ func routeExt(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
ext := strings.ToLower(uriChunks[1])
|
||||
ext_pat := fmt.Sprintf("/%s$/", ext)
|
||||
ext_pat := fmt.Sprintf("%s$", ext)
|
||||
files := []types.File{}
|
||||
err := gfs.Find(bson.M{"filename": ext_pat}).Sort("-metadata.timestamp").All(&files)
|
||||
err := gfs.Find(bson.M{"filename": bson.M{ "$regex": ext_pat, "$options": "i"}}).Sort("-metadata.timestamp").All(&files)
|
||||
if err != nil {
|
||||
serverErr(w, r, err)
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue