diff options
Diffstat (limited to 'internal/middlewares/util.go')
| -rw-r--r-- | internal/middlewares/util.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/middlewares/util.go b/internal/middlewares/util.go new file mode 100644 index 000000000..23f58f01a --- /dev/null +++ b/internal/middlewares/util.go @@ -0,0 +1,15 @@ +package middlewares + +import ( + "github.com/valyala/fasthttp" +) + +// SetContentTypeApplicationJSON sets the Content-Type header to `application/json; charset=utf8`. +func SetContentTypeApplicationJSON(ctx *fasthttp.RequestCtx) { + ctx.SetContentTypeBytes(contentTypeApplicationJSON) +} + +// SetContentTypeTextPlain sets the Content-Type header to `text/plain; charset=utf8`. +func SetContentTypeTextPlain(ctx *fasthttp.RequestCtx) { + ctx.SetContentTypeBytes(contentTypeTextPlain) +} |
