providers/app_gw: fix URL Validation not working for internal and external host

This commit is contained in:
Jens Langhammer 2020-08-01 20:02:43 +02:00
parent d4a5269bf1
commit 1a21012911
2 changed files with 38 additions and 2 deletions

View File

@ -0,0 +1,32 @@
# Generated by Django 3.0.8 on 2020-08-01 17:52
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("passbook_providers_app_gw", "0002_auto_20200726_1745"),
]
operations = [
migrations.AlterField(
model_name="applicationgatewayprovider",
name="external_host",
field=models.TextField(
validators=[
django.core.validators.URLValidator(schemes=("http", "https"))
]
),
),
migrations.AlterField(
model_name="applicationgatewayprovider",
name="internal_host",
field=models.TextField(
validators=[
django.core.validators.URLValidator(schemes=("http", "https"))
]
),
),
]

View File

@ -17,8 +17,12 @@ class ApplicationGatewayProvider(Provider):
Protocols by using a Reverse-Proxy.""" Protocols by using a Reverse-Proxy."""
name = models.TextField() name = models.TextField()
internal_host = models.TextField(validators=[URLValidator]) internal_host = models.TextField(
external_host = models.TextField(validators=[URLValidator]) validators=[URLValidator(schemes=("http", "https"))]
)
external_host = models.TextField(
validators=[URLValidator(schemes=("http", "https"))]
)
client = models.ForeignKey(Client, on_delete=models.CASCADE) client = models.ForeignKey(Client, on_delete=models.CASCADE)