Skip to content

Server generated links can contain multiple forward slashes #122

@paul121

Description

@paul121

If settings.SERVER_HOST contains a trailing forward slash then links a generated with a duplicate forward slash, breaking the link. I've seen this for authorization links, registration links and reset password links in utils.py :

server_host = settings.SERVER_HOST
link = f"{server_host}/authorize-farm/?farm_id={farm_id}&api_token={token.decode()}"

It may be easiest to validate settings.SERVER_HOST to always have a trailing /. Then we can use urllib.parse.urljoin(base, url) to build the link.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions