Skip to content

Commit 0433609

Browse files
Fix null ref in use_gzip
1 parent 4b6afb4 commit 0433609

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Saturn/Application.fs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,17 @@ module Application =
239239
.AddResponseCompression(fun o ->
240240
// Note: By default there is setting: o.EnableForHttps <- false
241241
// If your SSL-site doesn't contain any user sensitive data, consider changing that to true.
242-
o.MimeTypes <- Seq.append o.MimeTypes [|
242+
let additionalMime = [|
243243
"application/x-yaml";
244244
"image/svg+xml";
245245
"application/octet-stream";
246246
"application/x-font-ttf";
247247
"application/x-font-opentype";
248248
"application/x-javascript";
249249
"text/javascript";
250-
|])
250+
|]
251+
o.MimeTypes <- if not (isNull o.MimeTypes) then Seq.append o.MimeTypes additionalMime else Seq.ofArray (additionalMime)
252+
)
251253
let middleware (app : IApplicationBuilder) = app.UseResponseCompression()
252254

253255
{ state with

0 commit comments

Comments
 (0)