Commit e9baffd
authored
fix(utils): allow apostrophes and asterisks in extracted URLs (#3790)
Closes #2755
`RequestList`/`requestsFromUrl` extracts URLs from the fetched body with
`extractUrls`, which uses `URL_NO_COMMAS_REGEX` /
`URL_WITH_COMMAS_REGEX`. The path/query character class of those regexes
was missing `'` and `*`, both valid RFC 3986 path sub-delims, so a URL
was truncated at the first apostrophe or asterisk. The Zillow example
from the issue, `.../141-O'Canoe-Pl-Hertford-NC-27944/...`, came back as
`.../141-O`.
This adds `'` and `*` to the path/query class of both regexes (no logic
changes) so those URLs extract intact. `(` and `)` were already allowed
there.
Added two `extractUrls` cases (apostrophe, asterisk) that fail before
the change and pass after.1 parent 895ed62 commit e9baffd
2 files changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
99 | 112 | | |
100 | 113 | | |
101 | 114 | | |
| |||
0 commit comments