@@ -71,14 +71,13 @@ func listRegisteredDirectoriesRaw(url string) ([]registeredDirectory, error) {
7171}
7272
7373func listRegisteredSubdirectories (rest_url , dir string ) ([]string , error ) {
74- prefix := dir + "/"
75- output , err := listRegisteredDirectoriesRaw (rest_url + "/registered?path_prefix=" + url .QueryEscape (prefix ))
74+ output , err := listRegisteredDirectoriesRaw (rest_url + "/registered?within_path=" + url .QueryEscape (dir ))
7675 if err != nil {
7776 return nil , fmt .Errorf ("failed to list subdirectories of %q; %w" , dir , err )
7877 }
7978 collected := []string {}
8079 for _ , val := range output {
81- rel , err := filepath .Rel (prefix , val .Path )
80+ rel , err := filepath .Rel (dir , val .Path )
8281 if err == nil && filepath .IsLocal (rel ) {
8382 collected = append (collected , rel )
8483 }
@@ -158,8 +157,7 @@ func registerDirectory(rest_url, dir string, register bool) error {
158157}
159158
160159func deregisterAllSubdirectories (rest_url , dir string ) error {
161- prefix := dir + "/"
162- output , err := listRegisteredDirectoriesRaw (rest_url + "/registered?path_prefix=" + url .QueryEscape (prefix ))
160+ output , err := listRegisteredDirectoriesRaw (rest_url + "/registered?within_path=" + url .QueryEscape (dir ))
163161 if err != nil {
164162 return fmt .Errorf ("failed to list subdirectories of %q; %w" , dir , err )
165163 }
@@ -172,8 +170,7 @@ func deregisterAllSubdirectories(rest_url, dir string) error {
172170}
173171
174172func deregisterMissingSubdirectories (rest_url , dir string ) error {
175- prefix := dir + "/"
176- output , err := listRegisteredDirectoriesRaw (rest_url + "/registered?path_prefix=" + url .QueryEscape (prefix ) + "&exists=false" )
173+ output , err := listRegisteredDirectoriesRaw (rest_url + "/registered?within_path=" + url .QueryEscape (dir ) + "&exists=false" )
177174 if err != nil {
178175 return fmt .Errorf ("failed to list subdirectories of %q; %w" , dir , err )
179176 }
0 commit comments