summaryrefslogtreecommitdiff
path: root/internal/middlewares/util.go
blob: 03b80f557ac50f1985c89e51ea5ab35c10093a61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package middlewares

import (
	"github.com/valyala/fasthttp"
)

// SetContentTypeApplicationJSON sets the Content-Type header to `application/json; charset=utf-8`.
func SetContentTypeApplicationJSON(ctx *fasthttp.RequestCtx) {
	ctx.SetContentTypeBytes(contentTypeApplicationJSON)
}

// SetContentTypeTextPlain sets the Content-Type header to `text/plain; charset=utf-8`.
func SetContentTypeTextPlain(ctx *fasthttp.RequestCtx) {
	ctx.SetContentTypeBytes(contentTypeTextPlain)
}