소스 검색

fixed chapter_19 examples error :add http header (#814)

FrogIsToad 4 년 전
부모
커밋
fc532ba40d
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      eBook/examples/chapter_19/goto_v2/main.go

+ 1 - 0
eBook/examples/chapter_19/goto_v2/main.go

@@ -26,6 +26,7 @@ func Redirect(w http.ResponseWriter, r *http.Request) {
 func Add(w http.ResponseWriter, r *http.Request) {
 	url := r.FormValue("url")
 	if url == "" {
+		w.Header().Set("Content-Type", "text/html")
 		fmt.Fprint(w, AddForm)
 		return
 	}