cruzjoey0507 / pyfilemaker

Automatically exported from code.google.com/p/pyfilemaker
0 stars 0 forks source link

Validation error on FileMaker server hostname #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
FMServer class fails to validate hostname containing dashes. For example it 
reports "Address of FileMaker Server is not correctly formatted" when trying to 
connect to something like "login:password@fm-server.mydomain.com".

I suggest the following change to FMServer class:

---
39c39
<       m = 
re.match(r'^((?P<protocol>http)://)?((?P<login>\w+)(:(?P<password>\w+))?@)?(?P<h
ost>[\d\w\.]+)(:(?P<port>\d+))?/?(?P<address>/.+)?$', self._url)

---
>       m = 
re.match(r'^((?P<protocol>http)://)?((?P<login>\w+)(:(?P<password>\w+))?@)?(?P<h
ost>[\d\w\.\-]+)(:(?P<port>\d+))?/?(?P<address>/.+)?$', self._url)

---

Original issue reported on code.google.com by diavolet...@gmail.com on 25 Sep 2010 at 6:57