diff --git a/client/src/components/templates/Asset/AssetFile.test.tsx b/client/src/components/templates/Asset/AssetFile.test.tsx
index b0ac99f..9c19bbb 100644
--- a/client/src/components/templates/Asset/AssetFile.test.tsx
+++ b/client/src/components/templates/Asset/AssetFile.test.tsx
@@ -14,7 +14,7 @@ const file = {
index: 0,
url: 'https://hello.com',
contentType: 'application/x-zip',
- contentLength: 100
+ contentLength: '100'
}
const ddo = ({
diff --git a/client/src/components/templates/Asset/AssetFile.tsx b/client/src/components/templates/Asset/AssetFile.tsx
index 2b06a5b..3d9a9a3 100644
--- a/client/src/components/templates/Asset/AssetFile.tsx
+++ b/client/src/components/templates/Asset/AssetFile.tsx
@@ -119,11 +119,9 @@ export default class AssetFile extends PureComponent<
{contentType || contentLength ? (
<>
+ - {cleanupContentType(contentType)}
-
- {contentType && cleanupContentType(contentType)}
-
- -
- {contentLength && contentLength > 0
+ {contentLength && contentLength !== '0'
? filesize(contentLength)
: ''}
diff --git a/client/src/routes/Publish/Files/Item.test.tsx b/client/src/routes/Publish/Files/Item.test.tsx
index e0bb936..8246f73 100644
--- a/client/src/routes/Publish/Files/Item.test.tsx
+++ b/client/src/routes/Publish/Files/Item.test.tsx
@@ -8,7 +8,7 @@ describe('Item', () => {
url: 'https://hello.com/hello.zip',
found: true,
contentType: 'application/zip',
- contentLength: 10
+ contentLength: '10'
}
const { container } = render(
- null} />
@@ -21,7 +21,7 @@ describe('Item', () => {
url: 'https://hello.com/hello.zip',
found: false,
contentType: '',
- contentLength: 10
+ contentLength: '10'
}
const { container } = render(
- null} />
diff --git a/client/src/routes/Publish/Files/Item.tsx b/client/src/routes/Publish/Files/Item.tsx
index e411801..fb69fa5 100644
--- a/client/src/routes/Publish/Files/Item.tsx
+++ b/client/src/routes/Publish/Files/Item.tsx
@@ -11,7 +11,7 @@ const Item = ({
url: string
found: boolean
contentType: string
- contentLength: number
+ contentLength: string
}
removeFile(): void
}) => (
diff --git a/client/src/routes/Publish/Files/index.test.tsx b/client/src/routes/Publish/Files/index.test.tsx
index dd2236a..9142855 100644
--- a/client/src/routes/Publish/Files/index.test.tsx
+++ b/client/src/routes/Publish/Files/index.test.tsx
@@ -14,7 +14,7 @@ const files = [
url: 'https://hello.com',
checksum: 'cccccc',
checksumType: 'MD5',
- contentLength: 100,
+ contentLength: '100',
contentType: 'application/zip',
resourceId: 'xxx',
encoding: 'UTF-8',
diff --git a/server/src/routes/UrlCheckRouter.ts b/server/src/routes/UrlCheckRouter.ts
index 39364f5..a9517f6 100644
--- a/server/src/routes/UrlCheckRouter.ts
+++ b/server/src/routes/UrlCheckRouter.ts
@@ -42,9 +42,7 @@ export class UrlCheckRouter {
result.found = true
if (headers['content-length']) {
- result.contentLength = parseInt(
- headers['content-length']
- ) // convert to number
+ result.contentLength = headers['content-length']
}
// sometimes servers send content-range header,
@@ -54,7 +52,7 @@ export class UrlCheckRouter {
!headers['content-length']
) {
const size = headers['content-range'].split('/')[1]
- result.contentLength = parseInt(size) // convert to number
+ result.contentLength = size
}
if (headers['content-type']) {