Pārlūkot izejas kodu

content type header added

master
Patrick Peng Sun pirms 8 gadiem
vecāks
revīzija
bc4598d8b2
1 mainītis faili ar 2 papildinājumiem un 0 dzēšanām
  1. +2
    -0
      server.go

+ 2
- 0
server.go Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt