@@ -59,15 +59,15 @@ function handleSubmit()
59
59
60
60
document . getElementById ( 'get' ) . onclick = function ( ) {
61
61
xmlHttp = new XMLHttpRequest ( ) ;
62
- xmlHttp . open ( "GET" , "http: //"+ window . location . hostname + ":" + window . location . port + "/keys/" + document . getElementById ( "key" ) . value , false ) ;
62
+ xmlHttp . open ( "GET" , window . location . protocol + " //"+ window . location . hostname + ":" + window . location . port + "/keys/" + document . getElementById ( "key" ) . value , false ) ;
63
63
xmlHttp . send ( null ) ;
64
64
document . getElementById ( "response" ) . style . display = 'block' ;
65
65
document . getElementById ( "response" ) . innerHTML = xmlHttp . responseText ;
66
66
}
67
67
68
68
document . getElementById ( 'put' ) . onclick = function ( ) {
69
69
xmlHttp = new XMLHttpRequest ( ) ;
70
- xmlHttp . open ( "POST" , "http: //"+ window . location . hostname + ":" + window . location . port + "/keys/" + document . getElementById ( "key" ) . value , false ) ;
70
+ xmlHttp . open ( "POST" , window . location . protocol + " //"+ window . location . hostname + ":" + window . location . port + "/keys/" + document . getElementById ( "key" ) . value , false ) ;
71
71
var params = "value=" + document . getElementById ( "value" ) . value ;
72
72
73
73
xmlHttp . setRequestHeader ( "Content-type" , "application/x-www-form-urlencoded" ) ;
@@ -81,7 +81,7 @@ document.getElementById('put').onclick = function() {
81
81
82
82
document . getElementById ( 'delete' ) . onclick = function ( ) {
83
83
xmlHttp = new XMLHttpRequest ( ) ;
84
- xmlHttp . open ( "DELETE" , "http: //"+ window . location . hostname + ":" + window . location . port + "/keys/" + document . getElementById ( "key" ) . value , false ) ;
84
+ xmlHttp . open ( "DELETE" , window . location . protocol + " //"+ window . location . hostname + ":" + window . location . port + "/keys/" + document . getElementById ( "key" ) . value , false ) ;
85
85
xmlHttp . send ( null ) ;
86
86
document . getElementById ( "response" ) . style . display = 'block' ;
87
87
document . getElementById ( "response" ) . innerHTML = "Key deleted." ;
0 commit comments