Skip to content

Commit

Permalink
DeviceName fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
desistefanova committed Aug 21, 2024
1 parent 7e37f17 commit fd3c4e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions server/impl/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,12 @@ func UploadHandler(w http.ResponseWriter, r *http.Request) {
return
}

deviceId, err := filenamify.Filenamify(params["name"], filenamify.Options{
Replacement: "0",
})
deviceId, err := filenamify.Filenamify(params["name"], filenamify.Options{})
if err != nil {
utils.RenderError(w, WrongDateClassifier, http.StatusBadRequest)
return
}
filename, err := filenamify.Filenamify(params["filename"], filenamify.Options{
Replacement: "0",
})
filename, err := filenamify.Filenamify(params["filename"], filenamify.Options{})
if err != nil {
utils.RenderError(w, WrongDateClassifier, http.StatusBadRequest)
return
Expand Down
2 changes: 1 addition & 1 deletion server/utils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func GetImageFromFilePath(filePath string) (image.Image, error) {
if err != nil {
logger.Error(err)
}

defer reader.Close()
reader.Seek(0, 0)

m, _, err := image.Decode(reader)
Expand Down

0 comments on commit fd3c4e8

Please sign in to comment.