Skip to content

Commit

Permalink
Merge pull request openshift#41 from thesteve0/patch-1
Browse files Browse the repository at this point in the history
fix for origin bug #2675 which is in the sample-app
  • Loading branch information
bparees committed Jun 8, 2015
2 parents 2602ace + 8916ffd commit 05bb18a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions views/main.erb
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ function handleSubmit()

document.getElementById('get').onclick = function() {
xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", "http://"+window.location.hostname+":"+window.location.port+"/keys/"+document.getElementById("key").value, false );
xmlHttp.open( "GET",window.location.protocol+"//"+window.location.hostname+":"+window.location.port+"/keys/"+document.getElementById("key").value, false );
xmlHttp.send( null );
document.getElementById("response").style.display = 'block';
document.getElementById("response").innerHTML = xmlHttp.responseText;
}

document.getElementById('put').onclick = function() {
xmlHttp = new XMLHttpRequest();
xmlHttp.open( "POST", "http://"+window.location.hostname+":"+window.location.port+"/keys/"+document.getElementById("key").value, false );
xmlHttp.open( "POST", window.location.protocol+"//"+window.location.hostname+":"+window.location.port+"/keys/"+document.getElementById("key").value, false );
var params = "value="+document.getElementById("value").value;

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

document.getElementById('delete').onclick = function() {
xmlHttp = new XMLHttpRequest();
xmlHttp.open( "DELETE", "http://"+window.location.hostname+":"+window.location.port+"/keys/"+document.getElementById("key").value, false );
xmlHttp.open( "DELETE", window.location.protocol+"//"+window.location.hostname+":"+window.location.port+"/keys/"+document.getElementById("key").value, false );
xmlHttp.send( null );
document.getElementById("response").style.display = 'block';
document.getElementById("response").innerHTML = "Key deleted.";
Expand Down

0 comments on commit 05bb18a

Please sign in to comment.