Skip to content

Conversation

@varg1714
Copy link
Contributor

Description / 描述

  • 驱动初始化时检查路径合法性
  • 修复驱动路径配置错误时,link 接口报错问题

Motivation and Context / 背景

当前别名驱动未进行配置检查,因此实际运行过程中可能使用到一个不存在的驱动路径,且在 ResolveLinkCacheMode 函数中驱动获取时判断有问题,导致发生空指针异常。

Closes #1518

How Has This Been Tested? / 测试

在别名驱动中配置一个不存在的路径,然后访问该驱动,获取任意文件下载地址即可触发500报错。

Checklist / 检查清单

  • I have read the CONTRIBUTING document.
    我已阅读 CONTRIBUTING 文档。
  • I have formatted my code with go fmt or prettier.
    我已使用 go fmtprettier 格式化提交的代码。
  • I have added appropriate labels to this PR (or mentioned needed labels in the description if lacking permissions).
    我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
  • I have requested review from relevant code authors using the "Request review" feature when applicable.
    我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
  • I have updated the repository accordingly (If it’s needed).
    我已相应更新了相关仓库(若适用)。

@KirCute
Copy link
Member

KirCute commented Oct 23, 2025

我觉得这样改不好,将虚拟目录作为alias的后端路径是非常常见且合理的需求,应当考虑将ResolveLinkCacheMode函数修改为兼容后端目录是虚拟路径和无效路径的版本

已于 8fee628 解决

@varg1714
Copy link
Contributor Author

我觉得这样改不好,将虚拟目录作为alias的后端路径是非常常见且合理的需求,应当考虑将ResolveLinkCacheMode函数修改为兼容后端目录是虚拟路径和无效路径的版本

初始化操作中的逻辑已还原。

@KirCute KirCute changed the title fix(alias): Check the driver path during initialization fix(alias): nil panic in ResolveLinkCacheMode Oct 23, 2025
@KirCute KirCute merged commit 8f18e34 into OpenListTeam:main Oct 23, 2025
8 checks passed
@varg1714 varg1714 deleted the fix/varg-1023-alias branch November 4, 2025 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

使用别名访问网盘报错500内部服务器错误

3 participants