mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2025-05-02 18:09:56 +03:00
fix(warn): Refused to get unsafe header "www-authenticate"
This commit is contained in:
parent
73613a3b96
commit
21e3ad51af
3 changed files with 5 additions and 4 deletions
2
dist/docker-registry-ui.js
vendored
2
dist/docker-registry-ui.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "docker-registry-ui",
|
||||
"version": "2.0.8",
|
||||
"version": "2.0.9",
|
||||
"scripts": {
|
||||
"start": "ROLLUP_SERVE=true rollup -c -w",
|
||||
"build": "rollup -c",
|
||||
|
|
|
@ -53,7 +53,8 @@ export class Http {
|
|||
case 'loadend': {
|
||||
self.oReq.addEventListener('loadend', function () {
|
||||
if (this.status == 401 && !this.withCredentials) {
|
||||
const tokenAuth = parseAuthenticateHeader(this.getResponseHeader('www-authenticate'));
|
||||
const tokenAuth =
|
||||
this.hasHeader('www-authenticate') && parseAuthenticateHeader(this.getResponseHeader('www-authenticate'));
|
||||
self.onAuthentication(tokenAuth, (bearer) => {
|
||||
const req = new XMLHttpRequest();
|
||||
req._url = self._url;
|
||||
|
@ -65,7 +66,7 @@ export class Http {
|
|||
req.setRequestHeader(key, self._headers[key]);
|
||||
}
|
||||
if (bearer && bearer.token) {
|
||||
req.setRequestHeader('Authorization', `Bearer ${bearer.token}`)
|
||||
req.setRequestHeader('Authorization', `Bearer ${bearer.token}`);
|
||||
} else {
|
||||
req.withCredentials = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue