File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -1018,16 +1018,6 @@ func newBinMetadataCache(binFS http.FileSystem, binSha1Hashes map[string]string)
1018
1018
}
1019
1019
1020
1020
func (b * binMetadataCache ) getMetadata (name string ) (binMetadata , error ) {
1021
- // Reject any invalid or non-basename paths before touching the filesystem.
1022
- if name == "" ||
1023
- name == "." ||
1024
- strings .Contains (name , "/" ) ||
1025
- strings .Contains (name , "\\ " ) ||
1026
- ! fs .ValidPath (name ) ||
1027
- path .Base (name ) != name {
1028
- return binMetadata {}, os .ErrNotExist
1029
- }
1030
-
1031
1021
b .mut .RLock ()
1032
1022
metadata , ok := b .metadata [name ]
1033
1023
b .mut .RUnlock ()
@@ -1040,6 +1030,16 @@ func (b *binMetadataCache) getMetadata(name string) (binMetadata, error) {
1040
1030
b .sem <- struct {}{}
1041
1031
defer func () { <- b .sem }()
1042
1032
1033
+ // Reject any invalid or non-basename paths before touching the filesystem.
1034
+ if name == "" ||
1035
+ name == "." ||
1036
+ strings .Contains (name , "/" ) ||
1037
+ strings .Contains (name , "\\ " ) ||
1038
+ ! fs .ValidPath (name ) ||
1039
+ path .Base (name ) != name {
1040
+ return binMetadata {}, os .ErrNotExist
1041
+ }
1042
+
1043
1043
f , err := b .binFS .Open (name )
1044
1044
if err != nil {
1045
1045
return binMetadata {}, err
You can’t perform that action at this time.
0 commit comments