Skip to content

Commit 9aeecc2

Browse files
authored
Add gzip middleware support for gpx, +xml (#227)
1 parent 390226b commit 9aeecc2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

_examples/advanced-generic-openapi31/raw_body.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"context"
5+
56
"github.com/swaggest/usecase"
67
)
78

response/gzip/middleware.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,10 @@ func (rw *gzipResponseWriter) writeHeader(statusCode int) { //nolint:funlen
215215
"application/manifest+json",
216216
"application/ld+json",
217217
"application/graphql+json",
218+
"application/gpx+xml",
218219
"application/geo+json":
219220
default:
220-
if !strings.HasSuffix(ct, "+json") {
221+
if !strings.HasSuffix(ct, "+json") && !strings.HasSuffix(ct, "+xml") {
221222
rw.disableCompression = true
222223
}
223224
}

0 commit comments

Comments
 (0)