switched to PathUnescape
This commit is contained in:
		
							parent
							
								
									3ed042db71
								
							
						
					
					
						commit
						d02a1ebcd2
					
				@ -5,7 +5,9 @@ import (
 | 
			
		||||
	"encoding/xml"
 | 
			
		||||
	"io"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"net/url"
 | 
			
		||||
	"os"
 | 
			
		||||
	pathpkg "path"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"sync"
 | 
			
		||||
	"time"
 | 
			
		||||
@ -136,9 +138,11 @@ func (c *Client) ReadDir(path string) ([]os.FileInfo, error) {
 | 
			
		||||
 | 
			
		||||
		if p := getProps(r, "200"); p != nil {
 | 
			
		||||
			f := new(File)
 | 
			
		||||
 | 
			
		||||
			if ps, err := url.PathUnescape(r.Href); err == nil {
 | 
			
		||||
				f.name = pathpkg.Base(ps)
 | 
			
		||||
			} else {
 | 
			
		||||
				f.name = p.Name
 | 
			
		||||
 | 
			
		||||
			}
 | 
			
		||||
			f.path = path + f.name
 | 
			
		||||
			f.modified = parseModified(&p.Modified)
 | 
			
		||||
			f.etag = p.ETag
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user