upgrade deps; rewrite smtp session

This commit is contained in:
Aine
2024-02-19 22:55:14 +02:00
parent 10213cc7d7
commit a01720da00
277 changed files with 106832 additions and 7641 deletions

View File

@@ -1,6 +1,11 @@
package ratelimit
import "strings"
import (
"strings"
"golang.org/x/text/cases"
"golang.org/x/text/language"
)
// Reference:
// https://github.com/getsentry/relay/blob/0424a2e017d193a93918053c90cdae9472d164bf/relay-common/src/constants.rs#L116-L127
@@ -31,11 +36,11 @@ func (c Category) String() string {
case "":
return "CategoryAll"
default:
var b strings.Builder
b.WriteString("Category")
caser := cases.Title(language.English)
rv := "Category"
for _, w := range strings.Fields(string(c)) {
b.WriteString(strings.Title(w))
rv += caser.String(w)
}
return b.String()
return rv
}
}

View File

@@ -15,7 +15,7 @@ var errInvalidXSRLRetryAfter = errors.New("invalid retry-after value")
//
// Example
//
// X-Sentry-Rate-Limits: 60:transaction, 2700:default;error;security
// X-Sentry-Rate-Limits: 60:transaction, 2700:default;error;security
//
// This will rate limit transactions for the next 60 seconds and errors for the
// next 2700 seconds.