Browse code

BM-15289 Fix: index headers.to/cc, substring to 1024 characters

David Phan authored on 22/10/2019 12:17:47
Showing 1 changed files
... ...
@@ -192,7 +192,10 @@ public class IndexedMessageBody {
192 192
 	}
193 193
 
194 194
 	public Map<String, String> headers() {
195
-		return headers.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().toString()));
195
+		return headers.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> {
196
+			String s = e.getValue().toString();
197
+			return s.substring(0, Math.min(s.length(), 1024));
198
+		}));
196 199
 	}
197 200
 
198 201
 }