You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/12/23 15:06:35 UTC

[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #1110: fix: not allowed to specify `create_time` and `update_time` when create/edit route, service, upstream and consumer

juzhiyuan commented on a change in pull request #1110:
URL: https://github.com/apache/apisix-dashboard/pull/1110#discussion_r548002604



##########
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("not support specifying create_time")

Review comment:
       We may have a better error message, e.g `We don't accept create_time from client`?




----------------------------------------------------------------
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:
users@infra.apache.org