jellyfin / jellyfin-webos

WebOS Client for Jellyfin
https://jellyfin.org
Mozilla Public License 2.0
638 stars 65 forks source link

Relax URL validation #72

Closed dtparr closed 2 years ago

dtparr commented 2 years ago

Relaxes the URL validation to just ensure it begins with http:// or https:// (ignoring case), and that it has at least 1 character after that, with no spaces. This is mostly in line with the discussion of the short term fix for #21

Note that since this currently only runs on the output of normalizeUrl, it will be guaranteed to start with either https:// or http://, which is why I left that validation in there anyway.

Also note, I don't have the ability to run this locally, but since it's just replacing the regex, I felt it was worth dry-coding it using an online javascript regex tester to make sure I didn't typo anything. Would definitely want someone to test/validate before merging.

Addresses #21

anthonylavado commented 2 years ago

Thank you! I'll test this out on the emulator.

anthonylavado commented 2 years ago

I've tested this quite a bit now, and it seems to work as expected so far. Thank you!