var user = document.getElementById('user').value;
var password = document.getElementById('password').value;
var auth_url = document.getElementById('auth_url').value;
var request = new XMLHttpRequest();
request.onreadystatechange = function (oEvent) {
if (request.readyState == 4) { if (request.status == 200) { document.getElementById('token').value = request.getResponseHeader('X-Auth-Token'); document.getElementById('url').value = request.getResponseHeader('X-Storage-Url') + '/[container/object name here]';
} else { document.getElementById('auth_response_message').textContent = request.statusText || "Problem authenticating";
}
}
}
Broser console log:
XMLHttpRequest cannot load http://101.xxx.xx.48:38580/auth/v1.0. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 400.
Ubuntu - Swift All In One
tried set the `cors_allow_origin` in the proxy server config file, but still not work.
Test CORS Page: User<br> <input id="user" type="text" size="32" value=" test:tester" ><br><br> testing" ><br><br> 101.xxx. xx.48:38580/ auth/v1. 0"><br><br> response_ message" style="color: red"></pre>
Account:
Password<br><input id="password" type="text" size="32" value="
Auth URL<br><input id="auth_url" size="64" type="text" value="http://
<input id="getToken" type="button" value="Submit">
<pre id="auth_
<script>
$("#getToken" ).click( function () {
document. getElementById( 'token' ).value = null;
document. getElementById( 'auth_response_ message' ).textContent = null;
$(function(){
var user = document. getElementById( 'user') .value; getElementById( 'password' ).value; getElementById( 'auth_url' ).value;
var password = document.
var auth_url = document.
var request = new XMLHttpRequest();
if (request.readyState == 4) {
} else {
}
}
}
});
});
<script>
Broser console log: 101.xxx. xx.48:38580/ auth/v1. 0. No 'Access- Control- Allow-Origin' header is present on the requested resource. Origin 'http:// localhost' is therefore not allowed access. The response had HTTP status code 400.
XMLHttpRequest cannot load http://