vpn: fix key name regex
This commit is contained in:
parent
2ebc87f308
commit
f8d71b7b06
|
@ -40,7 +40,7 @@ Na vsaki napravi, ki jo želite povezati v omrežje FRI, ustvarite nov ključ. P
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<label for="name">Ime naprave</label><br>
|
<label for="name">Ime naprave</label><br>
|
||||||
<input id="name" name="name" pattern="[.-_A-Za-z0-9 ]*" maxlength="16" placeholder="A-Z a-z 0-9 . _ - " />
|
<input id="name" name="name" pattern="[-._A-Za-z0-9 ]*" maxlength="16" placeholder="A-Z a-z 0-9 . _ - " />
|
||||||
<button id="submit" type="submit">Ustvari ključ</button>
|
<button id="submit" type="submit">Ustvari ključ</button>
|
||||||
<p>
|
<p>
|
||||||
<input type="checkbox" id="add_default" name="add_default" />
|
<input type="checkbox" id="add_default" name="add_default" />
|
||||||
|
|
|
@ -63,7 +63,7 @@ def new():
|
||||||
else:
|
else:
|
||||||
return flask.Response('no more available IP addresses', status=500, mimetype='text/plain')
|
return flask.Response('no more available IP addresses', status=500, mimetype='text/plain')
|
||||||
now = datetime.datetime.utcnow()
|
now = datetime.datetime.utcnow()
|
||||||
name = re.sub('[^\w ]', '', flask.request.json.get('name', ''))
|
name = re.sub('[^-._A-Za-z0-9]', '', flask.request.json.get('name', ''))
|
||||||
|
|
||||||
keys[str(ip)] = {
|
keys[str(ip)] = {
|
||||||
'key': pubkey,
|
'key': pubkey,
|
||||||
|
|
Loading…
Reference in a new issue