mirror of https://github.com/huashengdun/webssh
Check private key size before submission
parent
664fe685b5
commit
906fcac436
|
@ -5,14 +5,21 @@ jQuery(function($){
|
||||||
|
|
||||||
$('form#connect').submit(function(event) {
|
$('form#connect').submit(function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
status.text('');
|
|
||||||
btn.prop('disabled', true);
|
|
||||||
|
|
||||||
var form = $(this),
|
var form = $(this),
|
||||||
url = form.attr('action'),
|
url = form.attr('action'),
|
||||||
type = form.attr('type'),
|
type = form.attr('type'),
|
||||||
data = new FormData(this);
|
data = new FormData(this);
|
||||||
|
|
||||||
|
var pk = data.get('privatekey');
|
||||||
|
if (pk && pk.size > 16384) {
|
||||||
|
status.text('Key size exceeds maximum value.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
status.text('');
|
||||||
|
btn.prop('disabled', true);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
type: type,
|
type: type,
|
||||||
|
|
Loading…
Reference in New Issue