Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(auth): use 'Token' as authentication header #7894

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arrio464
Copy link

fix #3829
验证头部可以从‘Authorization’和‘Token’中二选一,避免与basic auth的冲突

@arrio464
Copy link
Author

前端部分的PR:AlistGo/alist-web#242

@xhofe
Copy link
Collaborator

xhofe commented Jan 30, 2025

建议header名用X-Token,并兼容之前的逻辑,优先取X-Token,如果为空再取Authorization

@@ -8,6 +8,7 @@ import (
type Addition struct {
driver.RootPath
Address string `json:"url" required:"true"`
AuthHeader string `json:"auth_header" type:"select" options:"Authorization,X-Token" default:"X-Token"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的修改需要在init函数中判断下AuthHeader ,如果为空则设置默认值

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.

Nginx 反代 + auth_basic 时 401 错误
2 participants