File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " @lemonldap-ng/conf-rest" ,
3- "version" : " 0.7.0 " ,
3+ "version" : " 0.7.1 " ,
44 "description" : " lemonldap-ng class for REST configuration access" ,
55 "main" : " ./lib/index.js" ,
66 "module" : " ./lib/index.mjs" ,
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ test("lastCfg", (done) => {
2222
2323test ( "load" , ( done ) => {
2424 server . get ( / ^ .* $ / ) . mockImplementationOnce ( ( ctx ) => {
25- expect ( ctx . originalUrl ) . toEqual ( "/1 ?full=1" ) ;
25+ expect ( ctx . originalUrl ) . toMatch ( / ^ \/ + 1 \ ?f u l l = 1 $ / ) ;
2626 ctx . status = 200 ;
2727 ctx . body = '{"cfgNum":1,"f1":"field 1"}' ;
2828 } ) ;
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class RESTConf implements Conf_Accessor {
1919 if ( ! args . baseUrl . match ( / ( h t t p s ? ) : \/ \/ ( [ ^ / : ] + ) (?: : ( \d + ) ) ? ( .* ) / ) )
2020 throw new Error ( `Bad URL ${ args . baseUrl } ` ) ;
2121
22- this . baseUrl = args . baseUrl . split ( '/' , 1 ) [ 0 ] ;
22+ this . baseUrl = args . baseUrl . replace ( / \/ + $ / , "" ) ;
2323 if ( args . user ) {
2424 this . user = args . user ;
2525 if ( ! args . password ) throw new Error ( "password required" ) ;
You can’t perform that action at this time.
0 commit comments