mirror of
https://github.com/mainflux/mainflux.git
synced 2025-04-27 13:48:49 +08:00
NOISSUE - Fix Content-Type header check (#238)
* Remove charset from required content type Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Bump version to 0.2.1 Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Move constant to transport.go Signed-off-by: Dejan Mijic <dejan@mainflux.com>
This commit is contained in:
parent
544ba57850
commit
f449f8b9c8
@ -17,7 +17,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
contentType = "application/json; charset=utf-8"
|
||||
contentType = "application/json"
|
||||
invalidEmail = "userexample.com"
|
||||
wrongID = "123e4567-e89b-12d3-a456-000000000042"
|
||||
id = "123e4567-e89b-12d3-a456-000000000001"
|
||||
|
@ -7,8 +7,6 @@ import (
|
||||
"github.com/mainflux/mainflux/manager"
|
||||
)
|
||||
|
||||
const contentType = "application/json; charset=utf-8"
|
||||
|
||||
type apiRes interface {
|
||||
code() int
|
||||
headers() map[string]string
|
||||
|
@ -16,8 +16,12 @@ import (
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
)
|
||||
|
||||
var errUnsupportedContentType = errors.New("unsupported content type")
|
||||
var errInvalidQueryParams = errors.New("invalid query params")
|
||||
const contentType = "application/json"
|
||||
|
||||
var (
|
||||
errUnsupportedContentType = errors.New("unsupported content type")
|
||||
errInvalidQueryParams = errors.New("invalid query params")
|
||||
)
|
||||
|
||||
// MakeHandler returns a HTTP handler for API endpoints.
|
||||
func MakeHandler(svc manager.Service) http.Handler {
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
const version string = "0.2.0"
|
||||
const version string = "0.2.1"
|
||||
|
||||
type response struct {
|
||||
Version string
|
||||
|
Loading…
x
Reference in New Issue
Block a user