mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
fixed HTTP status codes write error
This commit is contained in:
@@ -175,10 +175,12 @@ func (slf *HttpSession) Write(msg []byte) {
|
||||
|
||||
func (slf *HttpSession) WriteJsonDone(statusCode int,msgJson interface{}) error {
|
||||
msg, err := json.Marshal(msgJson)
|
||||
if err == nil {
|
||||
slf.Write(msg)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
slf.statusCode = statusCode
|
||||
slf.Write(msg)
|
||||
slf.Done()
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user