ソースを参照

content type header added

master
Patrick Peng Sun 8年前
コミット
bc4598d8b2
1個のファイルの変更2行の追加0行の削除
  1. +2
    -0
      server.go

+ 2
- 0
server.go ファイルの表示

@@ -18,6 +18,7 @@ func apiV1Main(w http.ResponseWriter, r *http.Request) {
logRequestDebug(httputil.DumpRequest(r, true))
if checkSignature(r) == false {
log.Println("signature of URL incorrect")
w.Header().Set("Content-Type", "text/xml; charset=utf-8")
w.WriteHeader(http.StatusUnauthorized)
fmt.Fprintf(w, "") //empty string
return
@@ -60,6 +61,7 @@ func answerWechatPost(w http.ResponseWriter, r *http.Request) {
fmt.Printf("decrypt as: %s", d)
h := ReadCommonHeader(d)
reply, _ := BuildTextMsg(h.MsgType, h.FromUserName)
w.Header().Set("Content-Type", "text/xml; charset=utf-8")
fmt.Fprint(w, reply)
return
}

読み込み中…
キャンセル
保存