Value: string,
Protected?: boolean,
}
- }
+ },
+ TrustAllContent: boolean
};
Volumes: {
[key: string]: {
},
Collections: {
ForwardSlashNameSubstitution: "",
+ TrustAllContent: false,
},
Volumes: {},
...config
import { FileViewerAction } from 'views-components/context-menu/actions/file-viewer-action';
import { getNodeValue } from "models/tree";
import { ContextMenuKind } from 'views-components/context-menu/context-menu';
-import { getInlineFileUrl, sanitizeToken } from "./helpers";
+import { getInlineFileUrl, sanitizeToken, isInlineFileUrlSafe } from "./helpers";
const mapStateToProps = (state: RootState) => {
const { resource } = state.contextMenu;
ContextMenuKind.COLLECTION_DIRECTORY_ITEM,
ContextMenuKind.READONLY_COLLECTION_DIRECTORY_ITEM ].indexOf(resource.menuKind as ContextMenuKind) > -1) {
const file = getNodeValue(resource.uuid)(state.collectionPanelFiles);
- if (file) {
+ const shouldShowInlineUrl = isInlineFileUrlSafe(
+ file ? file.url : "",
+ state.auth.config.keepWebServiceUrl,
+ state.auth.config.keepWebInlineServiceUrl
+ ) || state.auth.config.clusterConfig.Collections.TrustAllContent;
+ if (file && shouldShowInlineUrl) {
const fileUrl = sanitizeToken(getInlineFileUrl(
file.url,
state.auth.config.keepWebServiceUrl,
inlineUrl = inlineUrl.replace(`/c=${collMatch[1]}`, '');
}
return inlineUrl;
-};
\ No newline at end of file
+};
+
+export const isInlineFileUrlSafe = (url: string, keepWebSvcUrl: string, keepWebInlineSvcUrl: string): boolean => {
+ let inlineUrl = keepWebInlineSvcUrl !== ""
+ ? url.replace(keepWebSvcUrl, keepWebInlineSvcUrl)
+ : url;
+ return inlineUrl.indexOf('*.') > -1;
+}
CollectionVersioning: true
PreserveVersionIfIdle: -1s
BlobSigningKey: zfhgfenhffzltr9dixws36j1yhksjoll2grmku38mi7yxd66h5j4q9w4jzanezacp8s6q0ro3hxakfye02152hncy6zml2ed0uc
- TrustAllContent: true
+ TrustAllContent: false
ForwardSlashNameSubstitution: /
ManagedProperties:
original_owner_uuid: {Function: original_owner, Protected: true}