Skip to content

Commit 63b2b87

Browse files
committed
fix: feedbacks
1 parent 650fec2 commit 63b2b87

File tree

4 files changed

+5
-24
lines changed

4 files changed

+5
-24
lines changed

9.0.0.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ rateLimit: {
4848
- Review your custom cloud routes and ensure they use the new path-to-regexp v8 syntax.
4949
- Update any rate-limiting configurations to use the new route path format.
5050
- Test your application to ensure all routes work as expected with the new syntax.
51-
- **Consult the [Express 5 Migration Guide](https://expressjs.com/en/guide/migrating-5.html#path-syntax) for more details on the new path syntax.**
51+
52+
> [!Note]
53+
> Consult the [path-to-regexp v8 docs](https://github.com/pillarjs/path-to-regexp) and the [Express 5 migration guide](https://expressjs.com/en/guide/migrating-5.html#path-syntax) for more details on the new path syntax.
5254
5355
### Related Pull Request
54-
- [#9942: feat: Bump path-to-regexp to v8](https://github.com/parse-community/parse-server/pull/9942)
56+
- [#9942](https://github.com/parse-community/parse-server/pull/9942)

spec/RateLimit.spec.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -481,14 +481,6 @@ describe('rate limit', () => {
481481
expect(() =>
482482
validateRateLimit({ rateLimit: [{ requestTimeWindow: 3, requestCount: 'abc' }] })
483483
).toThrow('rateLimit.requestPath must be defined');
484-
expect(() =>
485-
validateRateLimit({ rateLimit: [{ requestPath: '/*' }] })
486-
).toThrow(`rateLimit.requestPath "/*" uses deprecated wildcard syntax. ` +
487-
`Please update to path-to-regexp v8 syntax. Examples:\n` +
488-
` Old: "/functions/*" → New: "/functions/*path"\n` +
489-
` Old: "/classes/*" → New: "/classes/*path"\n` +
490-
` Old: "*" → New: "*path"\n` +
491-
`See parameter name on the express migration guide.`);
492484
await expectAsync(
493485
reconfigureServer({
494486
rateLimit: [{ requestTimeWindow: 3, requestCount: 1, path: 'abc', requestPath: 'a' }],

src/Config.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -689,19 +689,6 @@ export class Config {
689689
throw `rateLimit.requestPath must be a string`;
690690
}
691691

692-
// Validate path-to-regexp v8 syntax
693-
// Check for common old syntax patterns
694-
const oldWildcardPattern = /(?:^|\/)\*(?:\/|$)/; // Matches /* or * at start/end
695-
const nakedWildcard = /^[\s]*\*[\s]*$/; // Matches bare *
696-
if (oldWildcardPattern.test(option.requestPath) || nakedWildcard.test(option.requestPath)) {
697-
throw `rateLimit.requestPath "${option.requestPath}" uses deprecated wildcard syntax. ` +
698-
`Please update to path-to-regexp v8 syntax. Examples:\n` +
699-
` Old: "/functions/*" → New: "/functions/*path"\n` +
700-
` Old: "/classes/*" → New: "/classes/*path"\n` +
701-
` Old: "*" → New: "*path"\n` +
702-
`See parameter name on the express migration guide.`;
703-
}
704-
705692
// Validate that the path is valid path-to-regexp syntax
706693
try {
707694
pathToRegexp(option.requestPath);

src/Options/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ export interface ParseServerOptions {
350350
}
351351

352352
export interface RateLimitOptions {
353-
/* The path of the API route to be rate limited. Route paths, in combination with a request method, define the endpoints at which requests can be made. Route paths can be strings or string patterns following path-to-regexp v8 syntax. Wildcards must be named (e.g., `/*path` instead of `/*`). Examples: `/functions/*path`, `/classes/MyClass/*path`, `/*path`. See: https://github.com/pillarjs/path-to-regexp */
353+
/* The path of the API route to be rate limited. Route paths, in combination with a request method, define the endpoints at which requests can be made. Route paths can be strings or string patterns following <a href="https://github.com/pillarjs/path-to-regexp">path-to-regexp v8</a> syntax. */
354354
requestPath: string;
355355
/* The window of time in milliseconds within which the number of requests set in `requestCount` can be made before the rate limit is applied. */
356356
requestTimeWindow: ?number;

0 commit comments

Comments
 (0)