This repository was archived by the owner on Jun 23, 2026. It is now read-only.
Commit a14a5b7
committed
fix: address gemini-code-assist re-review on PR #1
Date-handling robustness:
- collect_rss._iso, collect_github.release_to_item, report._parse_iso,
score._parse_iso: fall back to the Unix epoch (1970-01-01) instead of
datetime.now(UTC) when a date is missing or corrupted. The old
behaviour gave malformed items a maximum freshness score and pushed
them to the top of every report; the new behaviour leaves them at
~0 freshness so they sink. [MEDIUM x4]
Network robustness:
- collect_rss.collect now fetches via urlopen with a 30s timeout and
passes the body to feedparser.parse, instead of feedparser.parse(url)
which has no built-in timeout. A single stuck origin no longer hangs
the whole pipeline. [MEDIUM]
XSS hardening:
- web/src/lib/markdown.ts pipes marked's output through
isomorphic-dompurify before returning. Report content is rendered via
`set:html`, and titles / summaries originate in untrusted RSS and
GitHub feeds, so unsanitized HTML could land in the page (verified by
smoke: a fixture with <script>, onerror, and javascript: URLs is
fully stripped). [SECURITY-MEDIUM]
Tests:
- tests/test_score.py: regression test that a garbage published_at
scores near-zero freshness. Locks in the epoch fallback.1 parent 405b8b7 commit a14a5b7
8 files changed
Lines changed: 617 additions & 9 deletions
File tree
- scripts/awsdd
- tests
- web
- src/lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| 27 | + | |
| 28 | + | |
23 | 29 | | |
24 | | - | |
| 30 | + | |
25 | 31 | | |
26 | 32 | | |
27 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
28 | 45 | | |
29 | 46 | | |
30 | 47 | | |
| |||
76 | 93 | | |
77 | 94 | | |
78 | 95 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
83 | 100 | | |
| 101 | + | |
84 | 102 | | |
85 | 103 | | |
86 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | | - | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | | - | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
0 commit comments