File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ var Ovh = function () {
51
51
this . timeout = params . timeout ;
52
52
this . apiTimeDiff = params . apiTimeDiff || null ;
53
53
this . endpoint = params . endpoint || null ;
54
+ this . noAuthPaths = params . noAuthPaths || [ '/auth/credential' , '/auth/time' ] ;
54
55
55
56
// Preconfigured API endpoints
56
57
if ( this . endpoint ) {
@@ -363,7 +364,7 @@ var Ovh = function () {
363
364
}
364
365
}
365
366
366
- if ( path . indexOf ( '/auth' ) < 0 ) {
367
+ if ( ! this . noAuthPaths . includes ( path ) ) {
367
368
options . headers [ 'X-Ovh-Timestamp' ] = Math . round ( Date . now ( ) / 1000 ) + this . apiTimeDiff ;
368
369
369
370
// Sign request
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ class Ovh {
43
43
this . timeout = params . timeout ;
44
44
this . apiTimeDiff = params . apiTimeDiff || null ;
45
45
this . endpoint = params . endpoint || null ;
46
+ this . noAuthPaths = params . noAuthPaths || [ '/auth/credential' , '/auth/time' ] ;
46
47
47
48
// Preconfigured API endpoints
48
49
if ( this . endpoint ) {
@@ -356,7 +357,7 @@ class Ovh {
356
357
}
357
358
}
358
359
359
- if ( path . indexOf ( '/auth' ) < 0 ) {
360
+ if ( ! this . noAuthPaths . includes ( path ) ) {
360
361
options . headers [ 'X-Ovh-Timestamp' ] = Math . round ( Date . now ( ) / 1000 ) + this . apiTimeDiff ;
361
362
362
363
// Sign request
@@ -487,4 +488,4 @@ class Ovh {
487
488
488
489
module . exports = function ( params ) {
489
490
return new Ovh ( params || { } ) ;
490
- } ;
491
+ } ;
You can’t perform that action at this time.
0 commit comments