Merge pull request #3700 from flec/fix-basic-auth

patch: fix flashing from URL when using basic auth
This commit is contained in:
bulldozer-balena[bot] 2022-02-21 13:17:31 +00:00 committed by GitHub
commit aba01825a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -315,6 +315,7 @@ export interface SourceMetadata extends sourceDestination.Metadata {
drive?: DrivelistDrive; drive?: DrivelistDrive;
extension?: string; extension?: string;
archiveExtension?: string; archiveExtension?: string;
auth?: Authentication;
} }
interface SourceSelectorProps { interface SourceSelectorProps {
@ -529,6 +530,7 @@ export class SourceSelector extends React.Component<
} }
if (metadata !== undefined) { if (metadata !== undefined) {
metadata.auth = auth;
selectionState.selectSource(metadata); selectionState.selectSource(metadata);
analytics.logEvent('Select image', { analytics.logEvent('Select image', {
// An easy way so we can quickly identify if we're making use of // An easy way so we can quickly identify if we're making use of

View File

@ -291,9 +291,14 @@ ipc.connectTo(IPC_SERVER_ID, () => {
url: imagePathObject.url, url: imagePathObject.url,
avoidRandomAccess: true, avoidRandomAccess: true,
axiosInstance: axios.create(_.omit(imagePathObject, ['url'])), axiosInstance: axios.create(_.omit(imagePathObject, ['url'])),
auth: options.image.auth,
}); });
} else { } else {
source = new Http({ url: imagePath, avoidRandomAccess: true }); source = new Http({
url: imagePath,
avoidRandomAccess: true,
auth: options.image.auth,
});
} }
} }
} }