fix: remove requestOptions when key is not needed
This commit is contained in:
parent
bad987a06b
commit
32bc47d315
@ -53,9 +53,6 @@ window.config = {
|
||||
qidoSupportsIncludeField: true,
|
||||
imageRendering: 'wadors',
|
||||
thumbnailRendering: 'wadors',
|
||||
requestOptions: {
|
||||
requestFromBrowser: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@ -59,9 +59,6 @@ window.config = {
|
||||
qidoSupportsIncludeField: true,
|
||||
imageRendering: 'wadors',
|
||||
thumbnailRendering: 'wadors',
|
||||
requestOptions: {
|
||||
requestFromBrowser: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@ -6,17 +6,21 @@ import user from '../user';
|
||||
/**
|
||||
* Returns the Authorization header as part of an Object.
|
||||
*
|
||||
* @returns {Object}
|
||||
* @export
|
||||
* @param {Object} [server={}]
|
||||
* @param {Object} [server.requestOptions]
|
||||
* @param {string} [server.requestOptions.auth]
|
||||
* @returns {Object} { Authorization }
|
||||
*/
|
||||
export default function getAuthorizationHeader(server) {
|
||||
export default function getAuthorizationHeader({ requestOptions } = {}) {
|
||||
const headers = {};
|
||||
|
||||
// Check for OHIF.user since this can also be run on the server
|
||||
const accessToken = user && user.getAccessToken && user.getAccessToken();
|
||||
|
||||
if (server && server.requestOptions && server.requestOptions.auth) {
|
||||
if (requestOptions && requestOptions.auth) {
|
||||
// HTTP Basic Auth (user:password)
|
||||
headers.Authorization = `Basic ${btoa(server.requestOptions.auth)}`;
|
||||
headers.Authorization = `Basic ${btoa(requestOptions.auth)}`;
|
||||
} else if (accessToken) {
|
||||
headers.Authorization = `Bearer ${accessToken}`;
|
||||
}
|
||||
|
||||
@ -11,9 +11,6 @@ describe('addServers', () => {
|
||||
qidoSupportsIncludeField: true,
|
||||
imageRendering: 'wadors',
|
||||
thumbnailRendering: 'wadors',
|
||||
requestOptions: {
|
||||
requestFromBrowser: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
oidc: [
|
||||
@ -52,7 +49,6 @@ describe('addServers', () => {
|
||||
name: 'DCM4CHEE',
|
||||
qidoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',
|
||||
qidoSupportsIncludeField: true,
|
||||
requestOptions: { requestFromBrowser: true },
|
||||
thumbnailRendering: 'wadors',
|
||||
type: 'dicomWeb',
|
||||
wadoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',
|
||||
|
||||
@ -13,9 +13,6 @@ window.config = {
|
||||
qidoSupportsIncludeField: true,
|
||||
imageRendering: 'wadors',
|
||||
thumbnailRendering: 'wadors',
|
||||
requestOptions: {
|
||||
requestFromBrowser: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@ -12,9 +12,6 @@ window.config = {
|
||||
qidoSupportsIncludeField: true,
|
||||
imageRendering: 'wadors',
|
||||
thumbnailRendering: 'wadors',
|
||||
requestOptions: {
|
||||
requestFromBrowser: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@ -11,9 +11,6 @@ window.config = {
|
||||
qidoSupportsIncludeField: false,
|
||||
imageRendering: 'wadors',
|
||||
thumbnailRendering: 'wadors',
|
||||
requestOptions: {
|
||||
requestFromBrowser: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@ -14,11 +14,10 @@ window.config = {
|
||||
thumbnailRendering: 'wadors',
|
||||
// REQUIRED TAG:
|
||||
// TODO: Remove tag after https://github.com/OHIF/ohif-core/pull/19 is merged and we bump version
|
||||
requestOptions: {
|
||||
// undefined to use JWT + Bearer auth
|
||||
// auth: 'orthanc:orthanc',
|
||||
requestFromBrowser: true,
|
||||
},
|
||||
// requestOptions: {
|
||||
// undefined to use JWT + Bearer auth
|
||||
// auth: 'orthanc:orthanc',
|
||||
// },
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@ -12,15 +12,11 @@ window.config = {
|
||||
qidoSupportsIncludeField: false,
|
||||
imageRendering: 'wadors',
|
||||
thumbnailRendering: 'wadors',
|
||||
// REQUIRED TAG:
|
||||
// https://github.com/OHIF/ohif-core/blob/59e1e04b92be24aee5d4402445cb3dcedb746995/src/studies/retrieveStudyMetadata.js#L54
|
||||
// TODO: Remove tag after https://github.com/OHIF/ohif-core/pull/19 is merged and we bump version
|
||||
requestOptions: {
|
||||
// undefined to use JWT + Bearer auth
|
||||
// auth: 'orthanc:orthanc',
|
||||
requestFromBrowser: true,
|
||||
},
|
||||
// requestOptions: {
|
||||
// undefined to use JWT + Bearer auth
|
||||
// auth: 'orthanc:orthanc',
|
||||
// },
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
@ -14,11 +14,10 @@ window.config = {
|
||||
imageRendering: 'wadors',
|
||||
thumbnailRendering: 'wadors',
|
||||
requestOptions: {
|
||||
requestFromBrowser: true,
|
||||
auth: 'admin:admin',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
studyListFunctionsEnabled: true,
|
||||
}
|
||||
};
|
||||
|
||||
@ -11,9 +11,6 @@ window.config = {
|
||||
qidoSupportsIncludeField: true,
|
||||
imageRendering: 'wadors',
|
||||
thumbnailRendering: 'wadors',
|
||||
requestOptions: {
|
||||
requestFromBrowser: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@ -11,15 +11,12 @@ window.config = {
|
||||
qidoSupportsIncludeField: true,
|
||||
imageRendering: 'wadors',
|
||||
thumbnailRendering: 'wadors',
|
||||
requestOptions: {
|
||||
requestFromBrowser: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
i18n: {
|
||||
LOCIZE_PROJECTID: 'a8da3f9a-e467-4dd6-af33-474d582a0294',
|
||||
LOCIZE_API_KEY: null, // Developers can use this to do in-context editing. DO NOT COMMIT THIS KEY!
|
||||
USE_LOCIZE: false
|
||||
}
|
||||
}
|
||||
USE_LOCIZE: false,
|
||||
},
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user