change: use isContainerIdentifier in FixedContentTypeMapper

This commit is contained in:
Ruben Taelman 2020-11-23 12:48:24 +01:00 committed by Joachim Van Herwegen
parent f686b4853f
commit f23073b87f

View File

@ -4,7 +4,7 @@ import { getLoggerFor } from '../../logging/LogUtil';
import { UnsupportedHttpError } from '../../util/errors/UnsupportedHttpError'; import { UnsupportedHttpError } from '../../util/errors/UnsupportedHttpError';
import { import {
encodeUriPathComponents, encodeUriPathComponents,
ensureTrailingSlash, ensureTrailingSlash, isContainerIdentifier,
trimTrailingSlashes, trimTrailingSlashes,
} from '../../util/PathUtil'; } from '../../util/PathUtil';
import type { FileIdentifierMapper, ResourceLink } from '../FileIdentifierMapper'; import type { FileIdentifierMapper, ResourceLink } from '../FileIdentifierMapper';
@ -35,7 +35,7 @@ export class FixedContentTypeMapper implements FileIdentifierMapper {
const filePath = getAbsolutePath(this.rootFilepath, path); const filePath = getAbsolutePath(this.rootFilepath, path);
// Container // Container
if (identifier.path.endsWith('/')) { if (isContainerIdentifier(identifier)) {
this.logger.debug(`URL ${identifier.path} points to the container ${filePath}`); this.logger.debug(`URL ${identifier.path} points to the container ${filePath}`);
return { return {
identifier, identifier,