@@ -389,22 +389,19 @@ struct NetworkInspectorRequestViewModel: Identifiable {
389389 )
390390
391391 let components = URLComponents ( string: url)
392+ let querySuffix = components? . percentEncodedQuery. map { " ? \( $0) " } ?? " "
392393 if let path = components? . path, !path. isEmpty {
393394 let parts = path. split ( separator: " / " , omittingEmptySubsequences: true )
394- primaryPathComponent = parts. last. map ( String . init) ?? path
395+ primaryPathComponent = ( parts. last. map ( String . init) ?? path) + querySuffix
395396 let remaining = parts. dropLast ( )
396397 if remaining. isEmpty {
397- secondaryPath = components ? . percentEncodedQuery . map { " ? \( $0 ) " } ?? " "
398+ secondaryPath = " "
398399 } else {
399400 let base = " / " + remaining. joined ( separator: " / " )
400- if let query = components? . percentEncodedQuery, !query. isEmpty {
401- secondaryPath = base + " ? " + query
402- } else {
403- secondaryPath = base
404- }
401+ secondaryPath = base
405402 }
406403 } else {
407- primaryPathComponent = url
404+ primaryPathComponent = url + querySuffix
408405 secondaryPath = " "
409406 }
410407
@@ -985,22 +982,18 @@ struct NetworkInspectorRequestSummary: Identifiable {
985982 }
986983
987984 let components = URLComponents ( string: url)
985+ let querySuffix = components? . percentEncodedQuery. map { " ? \( $0) " } ?? " "
988986 if let path = components? . path, !path. isEmpty {
989987 let parts = path. split ( separator: " / " , omittingEmptySubsequences: true )
990- primaryPathComponent = parts. last. map ( String . init) ?? path
988+ primaryPathComponent = ( parts. last. map ( String . init) ?? path) + querySuffix
991989 let remaining = parts. dropLast ( )
992990 if remaining. isEmpty {
993- secondaryPath = components ? . percentEncodedQuery . map { " ? \( $0 ) " } ?? " "
991+ secondaryPath = " "
994992 } else {
995- let base = " / " + remaining. joined ( separator: " / " )
996- if let query = components? . percentEncodedQuery, !query. isEmpty {
997- secondaryPath = base + " ? " + query
998- } else {
999- secondaryPath = base
1000- }
993+ secondaryPath = " / " + remaining. joined ( separator: " / " )
1001994 }
1002995 } else {
1003- primaryPathComponent = url
996+ primaryPathComponent = url + querySuffix
1004997 secondaryPath = " "
1005998 }
1006999
@@ -1055,27 +1048,19 @@ struct NetworkInspectorWebSocketSummary: Identifiable {
10551048 }
10561049
10571050 let components = URLComponents ( string: urlString)
1051+ let querySuffix = components? . percentEncodedQuery. map { " ? \( $0) " } ?? " "
10581052 if let path = components? . path, !path. isEmpty {
10591053 let parts = path. split ( separator: " / " , omittingEmptySubsequences: true )
1060- primaryPathComponent = parts. last. map ( String . init) ?? path
1054+ primaryPathComponent = ( parts. last. map ( String . init) ?? path) + querySuffix
10611055 let remaining = parts. dropLast ( )
10621056 if remaining. isEmpty {
1063- secondaryPath = components ? . percentEncodedQuery . map { " ? \( $0 ) " } ?? " "
1057+ secondaryPath = " "
10641058 } else {
1065- let base = " / " + remaining. joined ( separator: " / " )
1066- if let query = components? . percentEncodedQuery, !query. isEmpty {
1067- secondaryPath = base + " ? " + query
1068- } else {
1069- secondaryPath = base
1070- }
1059+ secondaryPath = " / " + remaining. joined ( separator: " / " )
10711060 }
10721061 } else {
1073- primaryPathComponent = components? . host ?? session. socketID
1074- if let query = components? . percentEncodedQuery, !query. isEmpty {
1075- secondaryPath = " ? \( query) "
1076- } else {
1077- secondaryPath = " "
1078- }
1062+ primaryPathComponent = ( components? . host ?? session. socketID) + querySuffix
1063+ secondaryPath = " "
10791064 }
10801065
10811066 showsActiveIndicator = session. cancelled == nil && session. failed == nil && session. closed == nil
0 commit comments