MSP-8438 Add setting for overriding standart json content-header to "application/json; charset=utf-8"

This commit is contained in:
Синельник Тимур Романович committed 2026-08-28 14:07:53 +03:00
1 parent 72f2d37920
commit 2fb58a7195
5 files changed
+50

No files matched your search

+10
View File
@@ -30,6 +30,8 @@ type Context struct {
adminToken string
queryParams map[string]string
httpJsonUtf8Charset bool
}
func NewContext(
@@ -114,6 +116,14 @@ func (c *Context) SetContext(ctx context.Context) {
c.request = c.request.WithContext(ctx)
}
func (c *Context) EnableHttpJsonUtf8Charset(enable bool) {
c.httpJsonUtf8Charset = enable
}
func (c *Context) IsJsonUtf8CharsetEnabled() bool {
return c.httpJsonUtf8Charset
}
func (c *Context) Param(name string) string {
value := c.request.Header.Get(name)
if value != "" {