Skip to content

Commit 55918f9

Browse files
Merge pull request #9 from SpectraLogic/bugfix/use-base-filepath
Use Base Filepath For Attachment Name
2 parents 32792d4 + 143d907 commit 55918f9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/openapi-generator/src/main/resources/go-server/routers.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"net/http"
2626
"net/url"
2727
"os"
28+
"path/filepath"
2829
"strconv"
2930
"strings"
3031
)
@@ -106,7 +107,7 @@ func EncodeJSONResponse(i interface{}, status *int,{{#addResponseHeaders}} heade
106107
return err
107108
}
108109
wHeader.Set("Content-Type", http.DetectContentType(data))
109-
wHeader.Set("Content-Disposition", "attachment; filename="+f.Name())
110+
wHeader.Set("Content-Disposition", "attachment; filename="+filepath.Base(f.Name()))
110111
if status != nil {
111112
w.WriteHeader(*status)
112113
} else {

0 commit comments

Comments
 (0)