Side navigation
#11364 closed bug (invalid)
Opened February 20, 2012 12:02PM UTC
Closed June 26, 2012 01:50PM UTC
ajax Basic Authentification does not seem to work in latest Chrome nightlies
| Reported by: | 343max | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | ajax | Version: | 1.7.1 |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
Description
This test:
$.ajax(tabulatabsServerPath + 'hello/hello_secure.json', {
type: 'GET',
username: 'Tester',
password: 'greets',
success: function(r) {
equal(r.greeted, 'Hello Tester!', 'authentification is working');
start();
}
});
always returns 401 not authorized in the latest Chrome Betas/Chrome Canries
I could fix it by manually setting the Authorization request header in the beforeSend callback:
$.ajax(tabulatabsServerPath + 'hello/hello_secure.json', {
type: 'GET',
username: 'Tester',
password: 'greets',
beforeSend: function(jqXHR, settings) {
if (settings.username) {
jqXHR.setRequestHeader('Authorization', 'Basic ' + base64_encode(settings.username + ':' + settings.password) + '==');
}
},
success: function(r) {
equal(r.greeted, 'Hello Tester!', 'authentification is working');
start();
}
});
Attachments (0)
Change History (3)
Changed February 20, 2012 12:22PM UTC by comment:1
Changed February 23, 2012 10:28AM UTC by comment:2
| component: | unfiled → ajax |
|---|---|
| priority: | undecided → low |
| status: | new → open |
Changed June 26, 2012 01:50PM UTC by comment:3
| resolution: | → invalid |
|---|---|
| status: | open → closed |
Since we haven't heard more about this I will assume it was a Chrome bug that got fixed before it was released.
You should create a ticket against webkit or chrome just to make sure this change is intended. If it is, then we'll proceed into adding yet another browser-specific trick.