mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-12 18:15:48 +00:00
fix: harden release issue parsing (#1536)
Hardens release issue parsing against a quadratic/ReDoS pattern while preserving parsing semantics.
This commit is contained in:
1 parent
10aff10a67
commit
74dd2f38cc
4 files changed
+59
-14
No files matched your search
@@ -30,6 +30,11 @@ describe('stable release issue cleanup', () => {
|
||||
expect(extractIssueNumbers(text, { includeRefs: false })).toEqual([12, 13, 14, 15]);
|
||||
});
|
||||
|
||||
it('handles long unmatched whitespace after an issue reference in linear time', () => {
|
||||
const text = `Fixes #1${' '.repeat(50_000)}X`;
|
||||
expect(extractIssueNumbers(text, { includeRefs: true })).toEqual([1]);
|
||||
});
|
||||
|
||||
it('extracts PR numbers from merge and squash commit subjects', () => {
|
||||
const text = [
|
||||
'Merge pull request #1392 from kaitranntt/kai/fix/foo',
|
||||
|
||||
Reference in new issue
Block a user