urljoin with leading slash remove part of path (#4332)

This commit is contained in:
jsurloppe 2016-08-01 15:14:55 +02:00 committed by Tom Christie
parent 5b071ab35e
commit e997713313

View File

@ -206,6 +206,9 @@ class SchemaGenerator(object):
else: else:
encoding = None encoding = None
if self.url and path.startswith('/'):
path = path[1:]
return coreapi.Link( return coreapi.Link(
url=urlparse.urljoin(self.url, path), url=urlparse.urljoin(self.url, path),
action=method.lower(), action=method.lower(),