From 9a6da21f71f2fa7c48445b2df1a06de953379f1c Mon Sep 17 00:00:00 2001 From: danielbosnich Date: Mon, 2 Mar 2026 08:22:00 -0700 Subject: [PATCH] Generates samples --- samples/openapi3/server/petstore/go/go-petstore/go/routers.go | 3 ++- .../server/others/go-server/no-body-path-params/go/routers.go | 3 ++- samples/server/petstore/go-api-server/go/routers.go | 3 ++- samples/server/petstore/go-chi-server/go/routers.go | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/samples/openapi3/server/petstore/go/go-petstore/go/routers.go b/samples/openapi3/server/petstore/go/go-petstore/go/routers.go index 7dc2f17a0684..bb99aa60c82f 100644 --- a/samples/openapi3/server/petstore/go/go-petstore/go/routers.go +++ b/samples/openapi3/server/petstore/go/go-petstore/go/routers.go @@ -21,6 +21,7 @@ import ( "net/http" "net/url" "os" + "path/filepath" "strconv" "strings" ) @@ -74,7 +75,7 @@ func EncodeJSONResponse(i interface{}, status *int, headers map[string][]string, 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 { diff --git a/samples/server/others/go-server/no-body-path-params/go/routers.go b/samples/server/others/go-server/no-body-path-params/go/routers.go index 392d00d7c0fa..ae67463577ce 100644 --- a/samples/server/others/go-server/no-body-path-params/go/routers.go +++ b/samples/server/others/go-server/no-body-path-params/go/routers.go @@ -20,6 +20,7 @@ import ( "net/http" "net/url" "os" + "path/filepath" "strconv" "strings" ) @@ -78,7 +79,7 @@ func EncodeJSONResponse(i interface{}, status *int, headers map[string][]string, 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 { diff --git a/samples/server/petstore/go-api-server/go/routers.go b/samples/server/petstore/go-api-server/go/routers.go index 0418d5e575ee..3a4f2e5e1a35 100644 --- a/samples/server/petstore/go-api-server/go/routers.go +++ b/samples/server/petstore/go-api-server/go/routers.go @@ -20,6 +20,7 @@ import ( "net/http" "net/url" "os" + "path/filepath" "strconv" "strings" ) @@ -78,7 +79,7 @@ func EncodeJSONResponse(i interface{}, status *int, headers map[string][]string, 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 { diff --git a/samples/server/petstore/go-chi-server/go/routers.go b/samples/server/petstore/go-chi-server/go/routers.go index 7dc2f17a0684..bb99aa60c82f 100644 --- a/samples/server/petstore/go-chi-server/go/routers.go +++ b/samples/server/petstore/go-chi-server/go/routers.go @@ -21,6 +21,7 @@ import ( "net/http" "net/url" "os" + "path/filepath" "strconv" "strings" ) @@ -74,7 +75,7 @@ func EncodeJSONResponse(i interface{}, status *int, headers map[string][]string, 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 {