jellyfin-vue
jellyfin-vue copied to clipboard
Regex url fix
Add Server form now accepts URLs without protocol.
Modified the regex of the url validator to accept server URLs that do not have a port or an HTTP protocol. The server form will now add a default port (8086) and protocol (http://) if none are present.
fix #1688
SonarCloud Quality Gate failed.
0 Bugs
0 Vulnerabilities
1 Security Hotspot
0 Code Smells
No Coverage information
0.0% Duplication
In my opinion, the default port should be 80 (regardless of the jellyfin server default port).
Do not you think? :)
For example I prefer to keep my jellyfin server deploy on 80 to use it comfortably from the local network by specifying only an IP and map it to another port possibly to expose it (but not too much).
This is why in my case it would be an inconvenience (and also different from what happens when you don't normally specify a port in http).
I also believe that it would not be clear for users
In my opinion, the default port should be 80 (regardless of the jellyfin server default port).
Do not you think? :)
For example I prefer to keep my jellyfin server deploy on 80 to use it comfortably from the local network by specifying only an IP and map it to another port possibly to expose it (but not too much).
This is why in my case it would be an inconvenience (and also different from what happens when you don't normally specify a port in http).
I also believe that it would not be clear for users
I have the same concerns as @doc-code-hub stated. I am also not using the default port. A better solution would be maybe, to first try the user provied URL, and if that not matches try with the default Jellyfin port. For the http protocol try the default 80, for https 443.
Also maybe I am wrong about this, but won't the new regex: ^(https?:\/\/)?[0-9.]+(:[0-9]+)?
only allow IP addresses and not DNS records? Wouldn't it cause problems?
So I'm gonna say what the others said already:
- The validation regex will only let IP go through
- I'm not sure if implicitly adding protocols and ports is good. What I'd see, but that's up to discussion, is that the client tries the different classic protocols and ports when typing something lacking one of them.
-
HOST
: it trieshttps://HOST:443
,https://HOST:8920
,http://HOST:80
,http://HOST:8096
in that order -
http://HOST
: it trieshttp://HOST:80
,http://HOST:8096
in that order -
HOST:PORT
: it trieshttps://HOST:PORT
,http://HOST:PORT
in that order
-
But that's my own take, and may not be optimal at all haha. In the best world I'd prefer it the current way, meaning specifying https or http and adding the port if it's not 443 or 80. But I understand that's it may not be the best way.
So I'm gonna say what the others said already:
* The validation regex will only let IP go through * I'm not sure if implicitly adding protocols and ports is good. What I'd see, but that's up to discussion, is that the client tries the different classic protocols and ports when typing something lacking one of them. * `HOST`: it tries `https://HOST:443`, `http://HOST:80`, `http://HOST:8096` in that order * `http://HOST`: it tries `http://HOST:80`, `http://HOST:8096` in that order * `HOST:PORT`: it tries `https://HOST:PORT`, `http://HOST:PORT` in that order
But that's my own take, and may not be optimal at all haha. In the best world I'd prefer it the current way, meaning specifying https or http and adding the port if it's not 443 or 80. But I understand that's it may not be the best way.
Maybe on HOST
also try https://HOST:8096
before http://HOST:8096
?
Yes that's a nice idea, though I'd use the SSL default port of JF, ie. 8920. I'll edit my message :)
Thanks for the insight guys. Admittedly, I didn't know much about IPs and Domains. I'm going to create an array of possible addresses according to this list and try to connect with each of them.
I'm going to leave DNS records alone