nic-chen commented on a change in pull request #1110: URL: https://github.com/apache/apisix-dashboard/pull/1110#discussion_r548536218
########## File path: api/filter/schema.go ########## @@ -106,6 +106,18 @@ func parseCert(crt, key string) ([]string, error) { } func handleSpecialField(resource string, reqBody []byte) ([]byte, error) { + var bodyMap map[string]interface{} + err := json.Unmarshal(reqBody, &bodyMap) + if err != nil { + return reqBody, fmt.Errorf("read request body failed: %s", err) + } + if _, ok := bodyMap["create_time"]; ok { + return reqBody, fmt.Errorf("we don't accept create_time from client") Review comment: fixed. ########## File path: api/filter/schema.go ########## @@ -106,6 +106,18 @@ func parseCert(crt, key string) ([]string, error) { } func handleSpecialField(resource string, reqBody []byte) ([]byte, error) { + var bodyMap map[string]interface{} + err := json.Unmarshal(reqBody, &bodyMap) + if err != nil { + return reqBody, fmt.Errorf("read request body failed: %s", err) + } + if _, ok := bodyMap["create_time"]; ok { + return reqBody, fmt.Errorf("we don't accept create_time from client") + } + if _, ok := bodyMap["update_time"]; ok { + return reqBody, fmt.Errorf("we don't accept update_time from client") Review comment: fixed. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org