mirror of
https://github.com/duanhf2012/origin.git
synced 2026-05-07 14:17:30 +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 {
|
func (slf *HttpSession) WriteJsonDone(statusCode int,msgJson interface{}) error {
|
||||||
msg, err := json.Marshal(msgJson)
|
msg, err := json.Marshal(msgJson)
|
||||||
if err == nil {
|
if err != nil {
|
||||||
slf.Write(msg)
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
slf.statusCode = statusCode
|
||||||
|
slf.Write(msg)
|
||||||
slf.Done()
|
slf.Done()
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user