1
0
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:
Dejan Mijić 2018-04-22 16:48:06 +02:00 committed by GitHub
parent 544ba57850
commit f449f8b9c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 6 deletions

View File

@ -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"

View File

@ -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

View File

@ -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 {

View File

@ -5,7 +5,7 @@ import (
"net/http"
)
const version string = "0.2.0"
const version string = "0.2.1"
type response struct {
Version string