Remove redundant's gin.H

master
René Jochum 2 years ago
parent c09905378e
commit f49b62f866
Signed by: jochum
GPG Key ID: F7D906F5E51E8E5E

@ -224,7 +224,7 @@ func (h *Handler) proxy(serviceName string, route *routerclientpb.RoutesReply_Ro
if err != nil { if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{ c.JSON(http.StatusInternalServerError, gin.H{
"errors": []gin.H{ "errors": []gin.H{
gin.H{ {
"id": "INTERNAL_SERVER_ERROR", "id": "INTERNAL_SERVER_ERROR",
"message": err, "message": err,
}, },
@ -243,7 +243,7 @@ func (h *Handler) proxy(serviceName string, route *routerclientpb.RoutesReply_Ro
if context.Reached { if context.Reached {
c.JSON(http.StatusTooManyRequests, gin.H{ c.JSON(http.StatusTooManyRequests, gin.H{
"errors": []gin.H{ "errors": []gin.H{
gin.H{ {
"id": "TO_MANY_REQUESTS", "id": "TO_MANY_REQUESTS",
"message": "To many requests", "message": "To many requests",
}, },
@ -308,7 +308,7 @@ func (h *Handler) proxy(serviceName string, route *routerclientpb.RoutesReply_Ro
if c.ContentType() == "" { if c.ContentType() == "" {
c.JSON(http.StatusUnsupportedMediaType, gin.H{ c.JSON(http.StatusUnsupportedMediaType, gin.H{
"errors": []gin.H{ "errors": []gin.H{
gin.H{ {
"id": "UNSUPPORTED_MEDIA_TYPE", "id": "UNSUPPORTED_MEDIA_TYPE",
"message": "provide a content-type header", "message": "provide a content-type header",
}, },
@ -337,7 +337,7 @@ func (h *Handler) proxy(serviceName string, route *routerclientpb.RoutesReply_Ro
if authErr != nil && authRequired { if authErr != nil && authRequired {
c.JSON(http.StatusUnauthorized, gin.H{ c.JSON(http.StatusUnauthorized, gin.H{
"errors": []gin.H{ "errors": []gin.H{
gin.H{ {
"id": "UNAUTHORIZED", "id": "UNAUTHORIZED",
"message": err, "message": err,
}, },
@ -350,7 +350,7 @@ func (h *Handler) proxy(serviceName string, route *routerclientpb.RoutesReply_Ro
if err != nil { if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{ c.JSON(http.StatusInternalServerError, gin.H{
"errors": []gin.H{ "errors": []gin.H{
gin.H{ {
"id": "INTERNAL_SERVER_ERROR", "id": "INTERNAL_SERVER_ERROR",
"message": err, "message": err,
}, },
@ -362,7 +362,7 @@ func (h *Handler) proxy(serviceName string, route *routerclientpb.RoutesReply_Ro
if err != nil { if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{ c.JSON(http.StatusInternalServerError, gin.H{
"errors": []gin.H{ "errors": []gin.H{
gin.H{ {
"id": "INTERNAL_SERVER_ERROR", "id": "INTERNAL_SERVER_ERROR",
"message": err, "message": err,
}, },
@ -377,7 +377,7 @@ func (h *Handler) proxy(serviceName string, route *routerclientpb.RoutesReply_Ro
if err != nil { if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{ c.JSON(http.StatusInternalServerError, gin.H{
"errors": []gin.H{ "errors": []gin.H{
gin.H{ {
"id": "INTERNAL_SERVER_ERROR", "id": "INTERNAL_SERVER_ERROR",
"message": err, "message": err,
}, },
@ -396,7 +396,7 @@ func (h *Handler) proxy(serviceName string, route *routerclientpb.RoutesReply_Ro
if context.Reached { if context.Reached {
c.JSON(http.StatusTooManyRequests, gin.H{ c.JSON(http.StatusTooManyRequests, gin.H{
"errors": []gin.H{ "errors": []gin.H{
gin.H{ {
"id": "TO_MANY_REQUESTS", "id": "TO_MANY_REQUESTS",
"message": "To many requests", "message": "To many requests",
}, },
@ -422,7 +422,7 @@ func (h *Handler) proxy(serviceName string, route *routerclientpb.RoutesReply_Ro
} }
c.JSON(code, gin.H{ c.JSON(code, gin.H{
"errors": []gin.H{ "errors": []gin.H{
gin.H{ {
"id": id, "id": id,
"message": pErr.Detail, "message": pErr.Detail,
}, },

Loading…
Cancel
Save