Actions
Issue #3476
closedBase path validation on distributions doesn't work depending on your hostname
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 34
Quarter:
Description
Ichimonji10 discovered that perfectly valid hostnames weren't being accepted after this PR got merged:
https://github.com/pulp/pulp/pull/3371
We're using django's URLValidator which apparently looks for a dot in the hostname:
https://github.com/django/django/blob/master/django/core/validators.py#L86
That is except if you are using localhost:
https://github.com/django/django/blob/master/django/core/validators.py#L93
Actions
Fixing problems with bad hostnames
Looks like django requires certain features of hostnames like a "." so using
get_host()
was not a good idea. Using a known valid hostname instead.fixes #3476 https://pulp.plan.io/issues/3476