Skip to content

Commit c102aaa

Browse files
committed
Fix deep search for headers
1 parent 9748b42 commit c102aaa

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Fix crash when exporting HAR file by @rounak in https://github.com/kean/Pulse/pull/299
99
- Fix concurrency issue in `StoreDetailsViewModel` by @ejensen in https://github.com/kean/Pulse/pull/302
1010
- Update the deep search. It will now show all search scopes found and only one match per scope. You can tap on a match to see the scope with a prepopulated search query to see the remaining items.
11+
- Fix an issue with deep search not working for request and response headers
1112

1213
## Pulse 5.1.1
1314

Sources/PulseUI/Features/Search/Services/ConsoleSearchOperation.swift

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,22 @@ final class ConsoleSearchOperation {
135135
if let string = task.requestBody.flatMap(service.getBodyString) {
136136
occurrences += ConsoleSearchOperation.search(string, term, scope)
137137
}
138-
case .originalRequestHeaders, .currentRequestHeaders, .responseHeaders:
139-
break // Reserved
138+
case .originalRequestHeaders:
139+
if let headers = task.originalRequest?.httpHeaders {
140+
occurrences += ConsoleSearchOperation.search(headers, term, scope)
141+
}
142+
case .currentRequestHeaders:
143+
if let headers = task.currentRequest?.httpHeaders {
144+
occurrences += ConsoleSearchOperation.search(headers, term, scope)
145+
}
140146
case .responseBody:
141147
if let string = task.responseBody.flatMap(service.getBodyString) {
142148
occurrences += ConsoleSearchOperation.search(string, term, scope)
143149
}
150+
case .responseHeaders:
151+
if let headers = task.response?.httpHeaders {
152+
occurrences += ConsoleSearchOperation.search(headers, term, scope)
153+
}
144154
case .message, .metadata:
145155
break // Applies only to LoggerMessageEntity
146156
}

0 commit comments

Comments
 (0)