Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7066343
D1295.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D1295.id.diff
View Options
diff --git a/swh/web/assets/src/bundles/browse/origin-search.js b/swh/web/assets/src/bundles/browse/origin-search.js
--- a/swh/web/assets/src/bundles/browse/origin-search.js
+++ b/swh/web/assets/src/bundles/browse/origin-search.js
@@ -97,10 +97,16 @@
for (let i = 0; i < patternsArray.length; ++i) {
patternsArray[i] = escapeStringRegexp(patternsArray[i]);
}
- let patternsPermut = [];
- heapsPermute(patternsArray, p => patternsPermut.push(p.join('.*')));
- let regex = patternsPermut.join('|');
- baseSearchUrl = Urls.browse_origin_search(regex) + `?regexp=true`;
+ // url length must be less than 4096 for modern browsers
+ // assuming average word length, 6 is max patternArray.length
+ if (patternsArray.length < 7) {
+ let patternsPermut = [];
+ heapsPermute(patternsArray, p => patternsPermut.push(p.join('.*')));
+ let regex = patternsPermut.join('|');
+ baseSearchUrl = Urls.browse_origin_search(regex) + `?regexp=true`;
+ } else {
+ baseSearchUrl = Urls.browse_origin_search(patternsArray.join('.*')) + `?regexp=true`;
+ }
}
let withVisit = $('#swh-search-origins-with-visit').prop('checked');
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Nov 5 2024, 6:19 AM (8 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3218451
Attached To
D1295: prevent high memory usage
Event Timeline
Log In to Comment