Skip to content
Permalink
Browse files

Fixed temporarly uploaded file extension to be lowercase

  • Loading branch information...
eko committed May 27, 2019
1 parent def5e54 commit 095a0ead6c3713ef4b0c5022988d153c3f543a6d
Showing with 3 additions and 1 deletion.
  1. +3 −1 middleware.go
@@ -183,7 +183,9 @@ func mapTemporaryFileToOperations() error {
return fmt.Errorf("Could not read multipart file. Reason: %v", err)
}

f, err := ioutil.TempFile(os.TempDir(), fmt.Sprintf("graphqlupload-*%s", filepath.Ext(handle.Filename)))
extension := strings.ToLower(filepath.Ext(handle.Filename))
filename := fmt.Sprintf("graphqlupload-*%s", extension)
f, err := ioutil.TempFile(os.TempDir(), filename)
if err != nil {
return fmt.Errorf("Unable to create temporary file. Reason: %v", err)
}

0 comments on commit 095a0ea

Please sign in to comment.
You can’t perform that action at this time.