Use resp.Code as the HTTP response code, unless the client has specifield they want 200-codes only.
This commit is contained in:
parent
851c90764a
commit
b3b4dde8f2
|
@ -55,9 +55,12 @@ func Method(f func(md common.MethodData) common.Response, db *sql.DB, privileges
|
||||||
|
|
||||||
resp := f(md)
|
resp := f(md)
|
||||||
if resp.Code == 0 {
|
if resp.Code == 0 {
|
||||||
c.IndentedJSON(500, resp)
|
resp.Code = 500
|
||||||
} else {
|
}
|
||||||
|
if _, exists := c.GetQuery("pls200"); exists {
|
||||||
c.IndentedJSON(200, resp)
|
c.IndentedJSON(200, resp)
|
||||||
|
} else {
|
||||||
|
c.IndentedJSON(resp.Code, resp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user