I have added some subscribed lists with spaces in the name which are encoded to %20 in the URL path. After adding these they cannot be deleted. The GUI displays the toast notification and says that deletion is successful but the list remains. Have narrowed test case down to adding a list URL as just %20 and it can't be deleted.
I don't have v5 to test with to see if this is a regression but I suspect it is, as it would surely have been detected previously.
I can confirm this behavior. Entries with XYZ%20.com
can't be deleted.
2024-01-08 13:36:48.304 [472116/T472166] DEBUG_API: Requested API URI: 10.0.1.202 -> POST /api/lists:batchDelete ? (null) (Content-Type application/x-www-form-urlencoded; charset=UTF-8)
2024-01-08 13:36:48.304 [472116/T472166] DEBUG_API: Received payload with size: 25
2024-01-08 13:36:48.305 [472116/T472166] DEBUG_API: Processing POST /api/lists:batchDelete in /api/lists:batchDelete
2024-01-08 13:36:48.306 [472116/T472166] DEBUG_API: SQL: INSERT INTO deltable (item) VALUES (:item);
2024-01-08 13:36:48.306 [472116/T472166] DEBUG_API: :item = "sdjfsdk+.com"
2024-01-08 13:36:48.559 [472116/T472166] DEBUG_API: Done
Response is a 404 not found.
id address enabled date_added date_modified comment date_updated number invalid_domains status abp_entries type
-- --------------------------------------------------------------------------------------- ------- ---------- ------------- -------------------------------------- ------------ ------- --------------- ------ ----------- ----
24 sdjfsdk%20.com 1 1704717327 1704717327 (null) (null) 0 0 0 0 0
@DL6ER Could be a regression of the batchDelete PR or a encoding issue (see %20
turned into +
)
DL6ER
January 8, 2024, 7:35pm
4
Thanks for the report, the fix is very simple:
pi-hole:development-v6
← pi-hole:fix/space-escape
opened 07:35PM - 08 Jan 24 UTC
# What does this implement/fix?
Fix deletion of addresses with spaces in them… by avoiding unwanted encoding to `application/x-www-form-urlencoded`
---
**Related issue or feature (if applicable):** https://discourse.pi-hole.net/t/v6-bug-unable-to-delete-subscribed-lists-with-20-in-url-field/67483
**Pull request in [docs](https://github.com/pi-hole/docs) with documentation (if applicable):** N/A
---
**By submitting this pull request, I confirm the following:**
1. I have read and understood the [contributors guide](https://docs.pi-hole.net/guides/github/contributing/), as well as this entire template. I understand which branch to base my commits and Pull Requests against.
2. I have commented my proposed changes within the code.
3. I am willing to help maintain this change if there are issues with it later.
4. It is compatible with the [EUPL 1.2 license](https://opensource.org/licenses/EUPL-1.1)
5. I have squashed any insignificant commits. ([`git rebase`](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html))
## Checklist:
- [x] The code change is tested and works locally.
- [x] I based my code and PRs against the repositories `developmental` branch.
- [x] I [signed off](https://docs.pi-hole.net/guides/github/how-to-signoff/) all commits. Pi-hole enforces the [DCO](https://docs.pi-hole.net/guides/github/dco/) for all contributions
- [x] I [signed](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) all my commits. Pi-hole requires signatures to verify authorship
- [x] I have read the above and my PR is ready for review.