python-osrm icon indicating copy to clipboard operation
python-osrm copied to clipboard

profile name adds * for any routing URL.

Open hannesaddec opened this issue 3 years ago • 4 comments

Code adds a start to the URL path This is needed in case someone needs to use the demo server URL router.project-osrm.org/*/v1/car

however in other case the star does not exists
https://github.com/ustroetz/python-osrm/blob/8abcd85e1159492c377c0f8f2357790d34b420ca/osrm/init.py#L26

IMHO the * needs to be removed in L23 and L26 so it reads return("/".join([self.host, self.version, self.profile]))

hannesaddec avatar May 11 '21 15:05 hannesaddec

@hannesaddec Can you provide more details on why this is an issue?

zifeo avatar Oct 07 '21 11:10 zifeo

if you run python-osrm and set it https://XXXXyourdomainxxxx/table/v1/car/4.3262100,50.8475730;4.3262100,50.8475730;4.3262100,50.8513870;4.3322340,50.8475730;4.3322340,50.8513870 - it fails as there is no '*' in the path... applies for varies endpoints e.g. we run it with a railway endpoint

hannesaddec avatar Oct 07 '21 12:10 hannesaddec

@hannesaddec what osrm.RequestConfig are you using?

zifeo avatar Oct 08 '21 09:10 zifeo

note that the '*' get suppressed - not good at markdown

osrm.RequestConfig.host = "SERVERNAME/route" osrm.RequestConfig SERVERNAME/route/''/v1/driving osrm.RequestConfig.profile = 'v1/car' osrm.RequestConfig SERVERNAME/route/''/v1/v1/car

IMHO anyone needing a '' in a URLpath should set it in either th host or the profile options l22ff in init.py should be modified from def str(self): return("/".join([self.host, '', self.version, self.profile]))

def __repr__(self):
    return("/".join([self.host, '*', self.version, self.profile]))

to

def __str__(self):
    return("/".join([self.host, self.version, self.profile]))

def __repr__(self):
    return("/".join([self.host,  self.version, self.profile]))

hannesaddec avatar May 12 '23 20:05 hannesaddec