mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-11 22:53:43 +08:00
fixed chapter_19 examples error :add http header (#814)
This commit is contained in:
@@ -26,6 +26,7 @@ func Redirect(w http.ResponseWriter, r *http.Request) {
|
|||||||
func Add(w http.ResponseWriter, r *http.Request) {
|
func Add(w http.ResponseWriter, r *http.Request) {
|
||||||
url := r.FormValue("url")
|
url := r.FormValue("url")
|
||||||
if url == "" {
|
if url == "" {
|
||||||
|
w.Header().Set("Content-Type", "text/html")
|
||||||
fmt.Fprint(w, AddForm)
|
fmt.Fprint(w, AddForm)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user