Merge pull request #2111 from zhulongcheng/fix-json-decode-500

fix(http): return http 400 if request data is invalid
pull/10616/head
Chris Goller 2018-12-21 08:38:58 -06:00 committed by GitHub
commit 088cf6e98e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -311,7 +311,8 @@ func decodePatchViewRequest(ctx context.Context, r *http.Request) (*patchViewReq
upd := platform.ViewUpdate{}
if err := json.NewDecoder(r.Body).Decode(&upd); err != nil {
return nil, &platform.Error{
Err: err,
Code: platform.EInvalid,
Err: err,
}
}