This is an automated email from the ASF dual-hosted git repository.

littlecui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-kie.git


The following commit(s) were added to refs/heads/master by this push:
     new 56d5157  add override field verification (#189)
56d5157 is described below

commit 56d5157e04925b1609ca9c2733c37b791d83350e
Author: Sphairis <[email protected]>
AuthorDate: Wed Jul 7 17:45:38 2021 +0800

    add override field verification (#189)
    
    * add override field verification
    
    * add override field verification
    
    * add override field verification
    
    * add override field verification
    
    Co-authored-by: SphaIris <aaalixiaopei123>
---
 server/resource/v1/kv_resource.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/server/resource/v1/kv_resource.go 
b/server/resource/v1/kv_resource.go
index a2c863d..275e6f5 100644
--- a/server/resource/v1/kv_resource.go
+++ b/server/resource/v1/kv_resource.go
@@ -41,6 +41,10 @@ type KVResource struct {
 
 //Upload upload kvs
 func (r *KVResource) Upload(rctx *restful.Context) {
+       if rctx.ReadQueryParameter(common.QueryParamOverride) == "" {
+               WriteErrResponse(rctx, config.ErrInvalidParams, "Query 
parameter 'override' is required")
+               return
+       }
        var err error
        inputUpload := new(KVUploadBody)
        if err = readRequest(rctx, &inputUpload); err != nil {

Reply via email to