Skip to content

Validation of dot-ended URL

Leonid Lunin requested to merge lrlunin/taurus:develop into develop

Dear taurus developers,

I discovered a small bug in the URL-validator. I found it using the WSL (Linux in Windows) machine where the /etc/hosts file has a very strange line: 127.0.1.1 DESKTOP-R3K4UKT. DESKTOP-R3K4UKT Then I found out that the first hostname ended with dot is actually a valid hostname for linux which means that the local domain is just empty. The network related stack (ping, curl, wget etc.) are able to resolute the DESKTOP-R3K4UKT. and the pytango also has no concerns or issues with the addresses like tango://DESKTOP-R3K4UKT.:10000/....

So I extended the taurus validator which Sardana uses for checks with the optional . at the end of the host. I guess I have also extended the test with this particular case but maybe you could also add a @invalid(name="tango://foo..:10000") (two dots) as invalid.

Thank you very much for the great efforts into the quality of code which was pleasure to read and develop. Merry Christmas and Happy New Year!

Merge request reports