Skip to content

Commit 05bb18a

Browse files
committed
Merge pull request openshift#41 from thesteve0/patch-1
fix for origin bug #2675 which is in the sample-app
2 parents 2602ace + 8916ffd commit 05bb18a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: views/main.erb

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ function handleSubmit()
5959

6060
document.getElementById('get').onclick = function() {
6161
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 );
6363
xmlHttp.send( null );
6464
document.getElementById("response").style.display = 'block';
6565
document.getElementById("response").innerHTML = xmlHttp.responseText;
6666
}
6767

6868
document.getElementById('put').onclick = function() {
6969
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 );
7171
var params = "value="+document.getElementById("value").value;
7272

7373
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
@@ -81,7 +81,7 @@ document.getElementById('put').onclick = function() {
8181

8282
document.getElementById('delete').onclick = function() {
8383
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 );
8585
xmlHttp.send( null );
8686
document.getElementById("response").style.display = 'block';
8787
document.getElementById("response").innerHTML = "Key deleted.";

0 commit comments

Comments
 (0)