Apply auth to http path as well
This commit is contained in:
@@ -37,8 +37,8 @@ type ZurgConfig struct {
|
||||
|
||||
Host string `yaml:"host" json:"host"`
|
||||
Port string `yaml:"port" json:"port"`
|
||||
Username string `yaml:"webdav_username" json:"webdav_username"`
|
||||
Password string `yaml:"webdav_password" json:"webdav_password"`
|
||||
Username string `yaml:"username" json:"username"`
|
||||
Password string `yaml:"password" json:"password"`
|
||||
NumOfWorkers int `yaml:"concurrent_workers" json:"concurrent_workers"`
|
||||
RefreshEverySeconds int `yaml:"check_for_changes_every_secs" json:"check_for_changes_every_secs"`
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ func (hs *Handlers) basicAuth(next http.Handler) http.Handler {
|
||||
|
||||
// needsAuth checks if the given path requires authentication.
|
||||
func needsAuth(path string) bool {
|
||||
authenticatedPaths := []string{"/dav/", "/infuse/"}
|
||||
authenticatedPaths := []string{"/http/", "/dav/", "/infuse/"}
|
||||
for _, p := range authenticatedPaths {
|
||||
if strings.HasPrefix(path, p) {
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user