Skip to content

Commit

Permalink
🎨 改进API 地址校验逻辑 (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
Well2333 authored Jan 12, 2025
1 parent 3ac11f0 commit 5780191
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nonebot_plugin_bilichat/request_api/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class RequestAPI:
def __init__(
self, api_base: URL, api_token: str, weight: int, note: str = "", *, skip_version_checking: bool = False
) -> None:
if ".example.com" in str(api_base):
raise ValueError(f"请设置正确的 API 地址 --> {api_base}")
if ".example.com" in str(api_base.host_subcomponent):
raise ValueError(f"无效的 API URL: {api_base}, 请配置一个有效的 API")
self._api_base = api_base
self._api_token = api_token
self._weight = weight
Expand Down

0 comments on commit 5780191

Please sign in to comment.