File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,14 @@ describe('server', () => {
26
26
} ) ;
27
27
} ) ;
28
28
29
+ it ( 'show warning if any reserved characters in appId' , done => {
30
+ spyOn ( console , 'warn' ) . and . callThrough ( ) ;
31
+ reconfigureServer ( { appId : 'test!-^' } ) . then ( ( ) => {
32
+ expect ( console . warn ) . toHaveBeenCalled ( ) ;
33
+ return done ( ) ;
34
+ } ) ;
35
+ } ) ;
36
+
29
37
it ( 'support http basic authentication with masterkey' , done => {
30
38
reconfigureServer ( { appId : 'test' } ) . then ( ( ) => {
31
39
request ( {
Original file line number Diff line number Diff line change @@ -376,6 +376,16 @@ function injectDefaults(options: ParseServerOptions) {
376
376
options . serverURL = `http://localhost:${ options . port } ${ options . mountPath } ` ;
377
377
}
378
378
379
+ // Reserved Characters
380
+ if ( options . appId ) {
381
+ const regex = / [ ! # $ % ' ( ) * + & / : ; = ? @ [ \] { } ^ , | < > ] / g;
382
+ if ( options . appId . match ( regex ) ) {
383
+ console . warn (
384
+ `\nWARNING, appId that contains special characters can cause issues while using with urls.\n`
385
+ ) ;
386
+ }
387
+ }
388
+
379
389
// Backwards compatibility
380
390
if ( options . userSensitiveFields ) {
381
391
/* eslint-disable no-console */
You can’t perform that action at this time.
0 commit comments