URLValidator ignores an explicit empty scheme allowlist
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
Research direction
The bug is in URLValidator from tortoise.validators; start in that class and look at how allowed_schemes is checked, since an empty list is currently treated like an omitted argument. Change the fallback so only None selects the default schemes, then run the reproduction snippet from the issue. Done means URLValidator(allowed_schemes=[]) raises InvalidScheme for https://example.com, and the default behaviour for an omitted or None argument is unchanged.
Written by the indexing model from the issue text.
Description
URLValidator falls back to the default schemes when allowed_schemes is an empty list. This prevents callers from configuring it to reject every URL scheme.
Reproduction
from tortoise.validators import URLValidator
URLValidator(allowed_schemes=[])("https://example.com")
Expected behavior is an InvalidScheme error. The default schemes should apply when the argument is omitted or None.
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 540
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 31
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tortoise/tortoise-orm
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
tortoise/tortoise-orm#668 ·
Maintainers usually reply within 2 days
-
in_transaction() leaks a pool connection when begin() is cancelledPossibly taken @inchang-ing claimed this 1 day ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 45/100
tortoise/tortoise-orm#2391 ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 40/100
tortoise/tortoise-orm#2383 · 2 comments ·
Maintainers usually reply within 2 days
-
Prefetch with to_attr leaves the attribute missing when all forward relations are nullPossibly taken @IlyaKhalafi claimed this 9 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
tortoise/tortoise-orm#2374 ·
Maintainers usually reply within 2 days
-
Adding a custom Prefetch to a cloned queryset mutates the original queryPossibly taken @IlyaKhalafi claimed this 9 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
tortoise/tortoise-orm#2372 ·
Maintainers usually reply within 2 days
All issues in tortoise/tortoise-orm
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
elviskahoro/sdk-python-attio#144 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
RenyiELBO raises TypeError when model has no sample sitesPossibly taken @alibb007 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
[Bug]: Four evaluation scripts unpack init_memmachine_params's five return values into three namesOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
MemMachine/MemMachine#1911 ·
Maintainers usually reply within 3 days