Skip to content

Commit 82752f1

Browse files
committed
Fix issue #187
1 parent 601ba7d commit 82752f1

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

src/server/server.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import requestIp from 'request-ip';
1111
import stream from 'stream';
1212
import { getRates as getExchangeRates } from 'services/money';
1313
import { toJson as xmlToJson } from 'utils/xml2json';
14+
import qs from 'qs';
1415

1516
// Dome API for topcoder communities
1617
import tcCommunitiesDemoApi from './tc-communities';
@@ -34,6 +35,8 @@ const app = express();
3435
* fix. */
3536
global.atob = atob;
3637

38+
app.set('query parser', str => qs.parse(str, { arrayLimit: 1000 }));
39+
3740
app.use(favicon(path.resolve(__dirname, '../assets/images/favicon.ico')));
3841
app.use(bodyParser.json());
3942
app.use(bodyParser.urlencoded({ extended: false }));

src/shared/routes/Communities/ChallengeListing.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function ChallengeListingRoute({ meta }) {
2020
'containers/challenge-listing/Listing',
2121
).then(({ default: ChallengeListing }) => {
2222
let query = routeProps.location.search;
23-
query = query ? qs.parse(query.slice(1)) : {};
23+
query = query ? qs.parse(query.slice(1), { arrayLimit: 1000 }) : {};
2424
const currencyFromUrl = query ? query.currency : undefined;
2525
const prizeMode = currencyFromUrl && `money-${currencyFromUrl}`;
2626
return (

src/shared/routes/Topcoder/ChallengeListing.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function ChallengeListingRoute() {
2020
'containers/challenge-listing/Listing',
2121
).then(({ default: ChallengeListing }) => {
2222
const query = renderProps.location.search ?
23-
qs.parse(renderProps.location.search.slice(1)) : null;
23+
qs.parse(renderProps.location.search.slice(1), { arrayLimit: 1000 }) : null;
2424
const currencyFromUrl = _.get(query, 'currency');
2525
const prizeMode = currencyFromUrl && `money-${currencyFromUrl}`;
2626
return (

src/shared/services/challenges.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class ChallengesService {
116116
filter: qs.stringify(filters),
117117
...params,
118118
};
119-
return this.private.api.get(`${endpoint}?${qs.stringify(query)}`)
119+
return this.private.api.get(`${endpoint}?${qs.stringify(query, { arrayLimit: 1000 })}`)
120120
.then(res => (res.ok ? res.json() : new Error(res.statusText)))
121121
.then(res => (
122122
res.result.status === 200 ? {

src/shared/utils/url.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import qs from 'qs';
1919
*/
2020
export function updateQuery(update) {
2121
if (!window) return;
22-
let query = qs.parse(window.location.search.slice(1));
22+
let query = qs.parse(window.location.search.slice(1), { arrayLimit: 1000 });
2323

2424
/* _.merge won't work here, because it just ignores the fields explicitely
2525
* set as undefined in the objects to be merged, rather than deleting such

0 commit comments

Comments
 (0)