ParamRanName = "ranName"
LimitRequest = 2000
)
+const ApplicationJson = "application/json"
+const ContentType = "Content-Type"
type INodebController interface {
Shutdown(writer http.ResponseWriter, r *http.Request)
}
c.logger.Infof("[E2 Manager -> Client] #NodebController.handleRequest - response: %s", result)
- writer.Header().Set("Content-Type", "application/json")
+ writer.Header().Set(ContentType, ApplicationJson)
writer.Write(result)
}
func (c *NodebController) validateRequestHeader(header *http.Header) error {
- if header.Get("Content-Type") != "application/json" {
+ if header.Get(ContentType) != ApplicationJson {
c.logger.Errorf("#NodebController.validateRequestHeader - validation failure, incorrect content type")
return e2managererrors.NewHeaderValidationError()
c.logger.Errorf("[E2 Manager -> Client] #NodebController.handleErrorResponse - http status: %d, error response: %+v", httpError, errorResponseDetails)
- writer.Header().Set("Content-Type", "application/json")
+ writer.Header().Set(ContentType, ApplicationJson)
writer.WriteHeader(httpError)
_, err = writer.Write(errorResponse)
}