diff --git a/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigController.java b/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigController.java index d10aa0dacbf..cbaffe84989 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigController.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigController.java @@ -626,6 +626,9 @@ public RestResult> importAndPublishConfig(HttpServletRequest failedData.put("succCount", 0); return RestResultUtils.buildResult(ResultCodeEnum.NAMESPACE_NOT_EXIST, failedData); } + if (StringUtils.isBlank(srcUser)) { + srcUser = RequestUtil.getSrcUserName(request); + } List configInfoList = new ArrayList<>(); List> unrecognizedList = new ArrayList<>(); try { @@ -900,7 +903,9 @@ public RestResult> cloneConfig(HttpServletRequest request, ci.getEncryptedDataKey() == null ? StringUtils.EMPTY : ci.getEncryptedDataKey()); configInfoList4Clone.add(ci4save); } - + if (StringUtils.isBlank(srcUser)) { + srcUser = RequestUtil.getSrcUserName(request); + } final String srcIp = RequestUtil.getRemoteIp(request); String requestIpApp = RequestUtil.getAppName(request); final Timestamp time = TimeUtils.getCurrentTime();