Browse Source

Fixed header and mime constants

Signed-off-by: Vishal Rana <[email protected]>
Vishal Rana 9 years ago
parent
commit
d8e70c5698

+ 5 - 5
frameworks/Go/echo/src/common/common.go

@@ -113,7 +113,7 @@ func (f FortunesByMessage) Less(i, j int) bool {
 func (h *handler) json() echo.HandlerFunc {
 	return func(c echo.Context) error {
 		c.Response().Header().Set("Server", "Echo")
-		c.Response().Header().Set(echo.ContentType, echo.ApplicationJSON)
+		c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSON)
 		return json.NewEncoder(c.Response()).Encode(Message{"Hello, World!"})
 	}
 }
@@ -127,7 +127,7 @@ func (h *handler) db() echo.HandlerFunc {
 		}
 
 		c.Response().Header().Set("Server", "Echo")
-		c.Response().Header().Set(echo.ContentType, echo.ApplicationJSON)
+		c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSON)
 		return json.NewEncoder(c.Response()).Encode(world)
 	}
 }
@@ -144,7 +144,7 @@ func (h *handler) queries() echo.HandlerFunc {
 		}
 
 		c.Response().Header().Set("Server", "Echo")
-		c.Response().Header().Set(echo.ContentType, echo.ApplicationJSON)
+		c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSON)
 		return json.NewEncoder(c.Response()).Encode(worlds)
 	}
 }
@@ -207,7 +207,7 @@ func (h *handler) updates() echo.HandlerFunc {
 		// }
 
 		c.Response().Header().Set("Server", "Echo")
-		c.Response().Header().Set(echo.ContentType, echo.ApplicationJSON)
+		c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSON)
 		return json.NewEncoder(c.Response()).Encode(worlds)
 	}
 }
@@ -216,7 +216,7 @@ func (h *handler) updates() echo.HandlerFunc {
 func (h *handler) plaintext() echo.HandlerFunc {
 	return func(c echo.Context) error {
 		c.Response().Header().Set("Server", "Echo")
-		c.Response().Header().Set(echo.ContentType, echo.TextPlain)
+		c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextPlain)
 		_, err := c.Response().Write(helloWorld)
 		return err
 	}

+ 1 - 1
frameworks/Go/echo/src/fasthttp/main.go

@@ -63,7 +63,7 @@ func main() {
 	e.SetRenderer(common.Template)
 	common.InitRoutes(e)
 	common.InitPostgres()
-	e.Run(fasthttp.NewFromConfig(engine.Config{
+	e.Run(fasthttp.WithConfig(engine.Config{
 		Listener: getListener(),
 	}))
 }