From 54ec2bfdad3dbbb0b8432f46a3975adfd80d2d4f Mon Sep 17 00:00:00 2001 From: dongjunduo Date: Tue, 14 Feb 2023 21:12:58 +0800 Subject: [PATCH 1/2] fix(admin): fix wrong http code for patch method --- apisix/core/etcd.lua | 2 +- t/admin/ssl.t | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apisix/core/etcd.lua b/apisix/core/etcd.lua index d48eb9aa1c7e..2c579aea8b53 100644 --- a/apisix/core/etcd.lua +++ b/apisix/core/etcd.lua @@ -507,7 +507,7 @@ function _M.atomic_set(key, value, ttl, mod_revision) key = key, value = value, } - res.status = 201 + res.status = 200 return res, nil end diff --git a/t/admin/ssl.t b/t/admin/ssl.t index 1a3dba80b16c..2e69e0b4671f 100644 --- a/t/admin/ssl.t +++ b/t/admin/ssl.t @@ -643,7 +643,7 @@ GET /t core.json.encode({create_time = 0, update_time = 1}) ) - if code ~= 201 then + if code ~= 200 then ngx.status = code ngx.say(body) return From cad8580137f3cbe256f6f3ba1e3a75fd33b413d3 Mon Sep 17 00:00:00 2001 From: dongjunduo Date: Wed, 15 Feb 2023 14:57:35 +0800 Subject: [PATCH 2/2] remove useless status value assign --- apisix/core/etcd.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/apisix/core/etcd.lua b/apisix/core/etcd.lua index 2c579aea8b53..99e4bbb6b7ab 100644 --- a/apisix/core/etcd.lua +++ b/apisix/core/etcd.lua @@ -507,7 +507,6 @@ function _M.atomic_set(key, value, ttl, mod_revision) key = key, value = value, } - res.status = 200 return res, nil end