forked from Ivasoft/opds-proxy
fix: panic when auth not specified
This commit is contained in:
@@ -332,6 +332,10 @@ func getCredentials(r *http.Request, feeds []FeedConfig, s *securecookie.SecureC
|
||||
continue
|
||||
}
|
||||
|
||||
if feed.Auth == nil || feed.Auth.Username == "" || feed.Auth.Password == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
// Only set feed credentials for local requests
|
||||
// when the auth config has local_only flag
|
||||
isLocal := r.Context().Value(isLocalRequest).(bool)
|
||||
@@ -339,10 +343,6 @@ func getCredentials(r *http.Request, feeds []FeedConfig, s *securecookie.SecureC
|
||||
continue
|
||||
}
|
||||
|
||||
if feed.Auth == nil || feed.Auth.Username == "" || feed.Auth.Password == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
return &Credentials{Username: feed.Auth.Username, Password: feed.Auth.Password}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user