Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pkg/server/errorshandler/handler_sentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ func (handler *Handler) HandleSentry(ctx *fasthttp.RequestCtx) {
// parse incoming get request params
sentryKey := ctx.QueryArgs().Peek("sentry_key")
if sentryKey == nil {
log.Warnf("Incoming request with deprecated sentry_key parameter")

// check that X-Sentry-Auth header is available
auth := ctx.Request.Header.Peek("X-Sentry-Auth")
if auth == nil {
Expand All @@ -50,15 +48,17 @@ func (handler *Handler) HandleSentry(ctx *fasthttp.RequestCtx) {

sentryEnvelopeBody := ctx.PostBody()

// todo: add check of gzip header
if sentryKey == nil {
contentEncoding := string(ctx.Request.Header.Peek("Content-Encoding"))
if contentEncoding == "gzip" {
sentryEnvelopeBody, err = decompressGzipString(sentryEnvelopeBody)
if err != nil {
log.Warnf("Failed to decompress gzip body: %s", err)
sendAnswerHTTP(ctx, ResponseMessage{Code: 400, Error: true, Message: "Failed to decompress gzip body"})
return
}
log.Debugf("Decompressed body: %s", sentryEnvelopeBody)
} else {
log.Debugf("Body: %s", sentryEnvelopeBody)
}

projectId, ok := handler.AccountsMongoDBClient.ValidTokens[hawkToken]
Expand Down
Loading