mirror of
https://github.com/YunoHost/dynette.git
synced 2024-09-03 20:06:17 +02:00
base64 dns key
This commit is contained in:
parent
5dc7dfb28a
commit
340ecea987
1 changed files with 2 additions and 1 deletions
|
@ -70,7 +70,8 @@ end
|
||||||
['/test/:subdomain', '/key/:public_key', '/ips/:public_key', '/ban/:ip', '/unban/:ip' ].each do |path|
|
['/test/:subdomain', '/key/:public_key', '/ips/:public_key', '/ban/:ip', '/unban/:ip' ].each do |path|
|
||||||
before path do
|
before path do
|
||||||
if params.has_key?("public_key")
|
if params.has_key?("public_key")
|
||||||
unless params[:public_key].match /^[a-z0-9]{22}==$/i
|
params[:public_key] = Base64.decode64(params[:public_key])
|
||||||
|
unless params[:public_key].length = 24
|
||||||
halt 400, { :error => "Key is invalid: #{params[:public_key]}" }.to_json
|
halt 400, { :error => "Key is invalid: #{params[:public_key]}" }.to_json
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue