Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const shouldEnableRateLimit = () => {
const getRateLimitMax = () => {
// Environment variable override takes precedence
if (process.env.RATE_LIMIT_MAX) {
return parseInt(process.env.RATE_LIMIT_MAX);
return parseInt(process.env.RATE_LIMIT_MAX, 10);
}

// Production: 100 requests per 15 minutes
Expand Down
4 changes: 2 additions & 2 deletions server/routes/questions.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ router.get('/', async (req, res) => {
.populate('author', 'username reputation avatar')
.sort(sortOption)
.skip(skip)
.limit(parseInt(limit))
.limit(parseInt(limit, 10))
.lean()

const total = await Question.countDocuments(query)
Expand All @@ -126,7 +126,7 @@ router.get('/', async (req, res) => {
res.json({
questions: questionsWithVirtuals,
pagination: {
currentPage: parseInt(page),
currentPage: parseInt(page, 10),
totalPages,
total,
hasNext: page < totalPages,
Expand Down