Skip to content

handle invalid or malformed URLs#276

Open
gregoryn22 wants to merge 2 commits intoSnd-R:masterfrom
gregoryn22:fix/url-sanitization
Open

handle invalid or malformed URLs#276
gregoryn22 wants to merge 2 commits intoSnd-R:masterfrom
gregoryn22:fix/url-sanitization

Conversation

@gregoryn22
Copy link
Contributor

Problem: invalid / malformed URLs can leak into WebLink patching (Komga) and MangaDex ebookjapan URL had an extra brace.

Fix: add WebLinkSanitizer to validate/normalize http(s) links + apply in Komga adapter; add tests; fix ebookjapan URL formatting.

Behavior change: non-http(s) or hostless links are dropped (warn-logged).

addresses behavior noted in #272

- Introduced `WebLinkSanitizer.kt` with functions to validate and sanitize HTTP/HTTPS URLs.
- Added `toValidHttpUrlOrNull` for URL parsing and normalization.
- Implemented `sanitizeHttpLinks` to filter and normalize a list of `WebLink` entries.
- Created unit tests in `WebLinkSanitizerTest.kt` to ensure functionality and correctness of URL handling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments