Skip to content

Commit

Permalink
ingest: disable gzip
Browse files Browse the repository at this point in the history
  • Loading branch information
absorbb committed Dec 18, 2023
1 parent 90601fc commit 6712725
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions ingest/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"bytes"
"compress/gzip"
"crypto/sha512"
"encoding/base64"
"encoding/json"
Expand Down Expand Up @@ -388,16 +387,16 @@ func (r *Router) IngestHandler(c *gin.Context) {
}
resp := r.processSyncDestination(ingestMessage, stream, ingestMessageBytes)
if resp != nil {
if r.ShouldCompress(c.Request) {
c.Header("Content-Encoding", "gzip")
c.Header("Content-Type", "application/json")
c.Header("Vary", "Accept-Encoding")
gz := gzip.NewWriter(c.Writer)
_ = json.NewEncoder(gz).Encode(resp)
_ = gz.Close()
} else {
c.JSON(http.StatusOK, resp)
}
//if r.ShouldCompress(c.Request) {
// c.Header("Content-Encoding", "gzip")
// c.Header("Content-Type", "application/json")
// c.Header("Vary", "Accept-Encoding")
// gz := gzip.NewWriter(c.Writer)
// _ = json.NewEncoder(gz).Encode(resp)
// _ = gz.Close()
//} else {
c.JSON(http.StatusOK, resp)
//}
} else {
c.JSON(http.StatusOK, gin.H{"ok": true})
}
Expand Down

0 comments on commit 6712725

Please sign in to comment.