resttesttest icon indicating copy to clipboard operation
resttesttest copied to clipboard

Adding CORS support

Open tibistibi opened this issue 6 years ago • 0 comments

To be able to send from one domain to an other I added this:

  myajax.crossDomain = true;
  if (checkForAuth())
  {
   var username = $("#authentication input:first").val();
   var password = $("#authentication input").eq(1).val();
   myajax.beforeSend =  function (xhr) {
          xhr.setRequestHeader ("Authorization", "Basic " + btoa(username+":"+password));
       };
  }

in the debug.js instead of this:

if (checkForAuth())
{
  myajax.username = $("#authentication input:first").val();
  myajax.password = $("#authentication input").eq(1).val();
}

tibistibi avatar Oct 28 '17 13:10 tibistibi