Repository navigation
Conversation
问题:login() 与 ListConfigs() 已实现 v3→v1 自动回退,但 GetConfig() 与 PublishConfig() 漏掉了 v1 分支,硬编码走 v3 路径 (/nacos/v3/client/cs/config、/nacos/v3/admin/cs/config)。 Nacos 2.x 服务端不存在这些 v3 路径,导致 config-get/config-set 直接 404。 修复:当 authLoginVersion == "v1" 时回退到 v1 实现,与 listConfigsV1 保持一致的协议差异: - 路径:/nacos/v1/cs/configs - 参数:group(非 groupName)、tenant(非 namespaceId) - 鉴权:accessToken 表单字段(非 Authorization: Bearer 头) - 响应:config-set 为字面量 true,config-get 为原始内容 验证:对 Nacos 2.5.1 standalone 服务端,config-set/config-get 均成功, 原始 push.sh 无需改动即可正常工作。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题:login() 与 ListConfigs() 已实现 v3→v1 自动回退,但 GetConfig() 与 PublishConfig() 漏掉了 v1 分支,硬编码走 v3 路径
(/nacos/v3/client/cs/config、/nacos/v3/admin/cs/config)。 Nacos 2.x 服务端不存在这些 v3 路径,导致 config-get/config-set 直接 404。
修复:当 authLoginVersion == "v1" 时回退到 v1 实现,与 listConfigsV1 保持一致的协议差异:
验证:对 Nacos 2.5.1 standalone 服务端,config-set/config-get 均成功, 原始 push.sh 无需改动即可正常工作。