Commit 9d832a1
committed
fix: accept civitai.red as an allowed CivitAI host
civitai.red is an official Civitai domain (NSFW-inclusive front door to
the same accounts, database, and REST API as civitai.com). Previously
the host allowlist only matched civitai.com, so the configured CivitAI
API token was never attached to civitai.red downloads and gated content
failed with 401.
Lift the allowed hosts to a single CIVITAI_ALLOWED_HOSTS constant in
constants.py and use it for both exact-match and subdomain-suffix checks.
Adding future Civitai TLDs is now a one-line change. Anti-spoofing
semantics (e.g. evilcivitai.red, civitai.red.evil.com) are preserved.
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>1 parent f33bdad commit 9d832a1
3 files changed
Lines changed: 39 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
102 | | - | |
| 104 | + | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
247 | 282 | | |
248 | 283 | | |
249 | 284 | | |
| |||
0 commit comments