Jetty, preflight and ajax
What does your base64encode
function do with the two parameters? The Authorization
header's value must be the base64 encoded value of the string username:password
. (Note the colon.)
Note: for same origin XMLHttpRequests, you can provide the username and password as a parameter to the open method.
The Authorization header should look like the following example:
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Where the text appearing after "Basic" is a base64 encoding of :
Check this link for more information:http://en.wikipedia.org/wiki/Basic_access_authentication