File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Sources/FoundationEssentials/URL Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -1176,12 +1176,14 @@ extension _SwiftURL {
11761176 ranges. append ( CFRange ( location: nsRange. location, length: nsRange. length) )
11771177 }
11781178
1179- flags. insert ( . hasPath)
1180- if let pathRange = parseInfo. pathRange {
1181- let nsRange = string. _toRelativeNSRange ( pathRange)
1182- ranges. append ( CFRange ( location: nsRange. location, length: nsRange. length) )
1183- } else {
1184- ranges. append ( CFRange ( location: kCFNotFound, length: 0 ) )
1179+ if !parseInfo. path. isEmpty || parseInfo. netLocationRange? . isEmpty == false {
1180+ flags. insert ( . hasPath)
1181+ if let pathRange = parseInfo. pathRange {
1182+ let nsRange = string. _toRelativeNSRange ( pathRange)
1183+ ranges. append ( CFRange ( location: nsRange. location, length: nsRange. length) )
1184+ } else {
1185+ ranges. append ( CFRange ( location: kCFNotFound, length: 0 ) )
1186+ }
11851187 }
11861188
11871189 if let queryRange = parseInfo. queryRange {
You can’t perform that action at this time.
0 commit comments