Probably urljoin would be safer.