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 2021/08/06 07:20:22 UTC

[GitHub] [apisix] zhendongcmss commented on a change in pull request #4765: fix(admin): inject updatetime when the requst is PATCH with sub path

zhendongcmss commented on a change in pull request #4765:
URL: https://github.com/apache/apisix/pull/4765#discussion_r684005418



##########
File path: t/admin/upstream4.t
##########
@@ -560,3 +560,35 @@ passed
     }
 --- response_body
 [delete] code: 200 message: passed
+
+
+
+=== TEST 17: patch upstream with sub_path, the data is number
+--- config
+    location /t {
+        content_by_lua_block {
+            local json = require("toolkit.json")
+            local t = require("lib.test_admin").test
+            local code, message = t('/apisix/admin/upstreams/1',
+                 ngx.HTTP_PUT,
+                 [[{
+                    "nodes": {},
+                    "type": "roundrobin"
+                 }]]
+            )
+            if code >= 300 then
+                ngx.status = code
+                ngx.say(message)
+                return
+            end
+
+            local code, message = t('/apisix/admin/upstreams/1/retries',
+                 ngx.HTTP_PATCH,
+                 json.encode(1)
+            )
+            if code >= 300 then
+                ngx.status = code
+            end
+            ngx.say(message)

Review comment:
       I suggest add PATCH body is json format like:
   ```
   curl http://127.0.0.1:9080/apisix/admin/upstreams/100/nodes  -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -i -X PATCH -d '
   {
       "39.97.63.215:80": 1,
       "39.97.63.215:81": 1
   }'
   ```




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org