Browse Source

Merge pull request #1848 from valyala/master

fasthttp: added missing ';charset=utf-8' suffix to Content-Type for p…
Nate 9 years ago
parent
commit
e33f4cff6c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      frameworks/Go/fasthttp/src/hello/hello.go

+ 2 - 2
frameworks/Go/fasthttp/src/hello/hello.go

@@ -156,7 +156,7 @@ func fortuneHandler(ctx *fasthttp.RequestCtx) {
 
 	sort.Sort(FortunesByMessage(fortunes))
 
-	ctx.SetContentType("text/html")
+	ctx.SetContentType("text/html; charset=utf-8")
 	if err := tmpl.Execute(ctx, fortunes); err != nil {
 		log.Fatalf("Error executing fortune: %s", err)
 	}
@@ -195,7 +195,7 @@ func updateHandler(ctx *fasthttp.RequestCtx) {
 
 // Test 6: Plaintext
 func plaintextHandler(ctx *fasthttp.RequestCtx) {
-	ctx.Success("text/plain", helloWorldBytes)
+	ctx.Write(helloWorldBytes)
 }
 
 func jsonMarshal(ctx *fasthttp.RequestCtx, v interface{}) {