Skip to content

Commit d3c59e0

Browse files
fix: correct config validation to check proper field lengths
Fixed bug where endpoint_url and region_name validation incorrectly checked len(config.access_key) instead of the actual field being validated. This was preventing environment variables from being properly loaded for Miku MCP server. Changes: - Line 44: Check len(config.secret_key) instead of len(config.access_key) - Line 48: Check len(config.endpoint_url) instead of len(config.access_key) - Line 50: Check len(config.region_name) instead of len(config.access_key) 🤖 Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: callmefisher <[email protected]>
1 parent 2467f01 commit d3c59e0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/mcp_server/config/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ def load_config() -> Config:
4141

4242
if not config.access_key or len(config.access_key) == 0:
4343
config.access_key = "YOUR_QINIU_ACCESS_KEY"
44-
if not config.secret_key or len(config.access_key) == 0:
44+
if not config.secret_key or len(config.secret_key) == 0:
4545
config.secret_key = "YOUR_QINIU_SECRET_KEY"
4646
if not config.api_key or len(config.api_key) == 0:
4747
config.api_key = "YOUR_QINIU_API_KEY"
48-
if not config.endpoint_url or len(config.access_key) == 0:
48+
if not config.endpoint_url or len(config.endpoint_url) == 0:
4949
config.endpoint_url = "YOUR_QINIU_ENDPOINT_URL"
50-
if not config.region_name or len(config.access_key) == 0:
50+
if not config.region_name or len(config.region_name) == 0:
5151
config.region_name = "YOUR_QINIU_REGION_NAME"
5252

5353
logger.info(f"Configured access_key: {config.access_key}")

0 commit comments

Comments
 (0)