diff --git a/modules/openapi-generator/src/main/resources/go-server/routers.mustache b/modules/openapi-generator/src/main/resources/go-server/routers.mustache index bd428097de4d..31ad0880406e 100644 --- a/modules/openapi-generator/src/main/resources/go-server/routers.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/routers.mustache @@ -25,6 +25,7 @@ import ( "net/http" "net/url" "os" + "path/filepath" "strconv" "strings" ) @@ -106,7 +107,7 @@ func EncodeJSONResponse(i interface{}, status *int,{{#addResponseHeaders}} heade return err } wHeader.Set("Content-Type", http.DetectContentType(data)) - wHeader.Set("Content-Disposition", "attachment; filename="+f.Name()) + wHeader.Set("Content-Disposition", "attachment; filename="+filepath.Base(f.Name())) if status != nil { w.WriteHeader(*status) } else {