Skip to content

Commit 3b0139f

Browse files
authored
Merge pull request #7066 from topcoder-platform/develop
Merge recent develop to branch
2 parents 545c9ca + 2437f66 commit 3b0139f

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

src/server/index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ const getTimestamp = async () => {
4848
throw new Error('Invalid file path detected');
4949
}
5050

51-
const MAX_FILE_SIZE = 10 * 1024; // 10 KB max file size
52-
const stats = await promisify(fs.stat)(filePath);
53-
if (stats.size > MAX_FILE_SIZE) {
54-
throw new Error('File is too large and may cause DoS issues');
55-
}
51+
// const MAX_FILE_SIZE = 10 * 1024; // 10 KB max file size
52+
// const stats = await promisify(fs.stat)(filePath);
53+
// if (stats.size > MAX_FILE_SIZE) {
54+
// throw new Error('File is too large and may cause DoS issues');
55+
// }
5656

5757
const fileContent = await promisify(fs.readFile)(filePath, 'utf-8');
5858

src/server/services/communities.js

+11-8
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ const getValidIds = async (METADATA_PATH) => {
4444
// Check if the file exists
4545
await promisify(fs.access)(uri);
4646

47-
// Get file stats
48-
const stats = await promisify(fs.stat)(uri);
49-
const MAX_FILE_SIZE = 1 * 1024 * 1024; // 1 MB
50-
if (stats.size > MAX_FILE_SIZE) {
51-
console.warn(`Metadata file too large for ID: ${id}`);
52-
return null; // Exclude invalid ID
53-
}
47+
// // Get file stats
48+
// const stats = await promisify(fs.stat)(uri);
49+
// const MAX_FILE_SIZE = 1 * 1024 * 1024; // 1 MB
50+
// if (stats.size > MAX_FILE_SIZE) {
51+
// console.warn(`Metadata file too large for ID: ${id}`);
52+
// return null; // Exclude invalid ID
53+
// }
5454

5555
// Parse and validate JSON
5656
const meta = JSON.parse(await promisify(fs.readFile)(uri, 'utf8'));
@@ -61,21 +61,24 @@ const getValidIds = async (METADATA_PATH) => {
6161
if (typeof subdomain === 'string') {
6262
SUBDOMAIN_COMMUNITY[subdomain] = id;
6363
} else {
64+
// eslint-disable-next-line no-console
6465
console.warn(`Invalid subdomain entry for ID: ${id}`);
6566
}
6667
});
6768
}
6869

6970
return id;
7071
} catch (e) {
72+
// eslint-disable-next-line no-console
7173
console.error(`Error processing metadata for ID: ${id}`, e.message);
72-
return null;
74+
return [];
7375
}
7476
});
7577

7678
const results = await Promise.all(validationPromises);
7779
VALID_IDS = results.filter(id => id !== null);
7880
} catch (err) {
81+
// eslint-disable-next-line no-console
7982
console.error(`Error reading metadata directory: ${METADATA_PATH}`, err.message);
8083
return [];
8184
}

src/shared/components/Contentful/ArticleCard/ArticleCard.jsx

+5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ class ArticleCard extends React.Component {
6464
themeName,
6565
} = this.props;
6666

67+
if (!theme) {
68+
// eslint-disable-next-line no-console
69+
console.log('ArticleCard: missing theme property');
70+
}
71+
6772
// determine if article cards will redirect to external link or article details page
6873
const articlePageUrl = article.externalArticle && article.contentUrl
6974
? article.contentUrl

0 commit comments

Comments
 (0)