File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -181,8 +181,10 @@ function check(database, cb) {
181
181
182
182
function onResponse ( response ) {
183
183
var status = response . statusCode ;
184
-
185
- if ( status !== 200 ) {
184
+
185
+ if ( status === 301 || status === 302 || status === 303 || status === 307 || status === 308 ) {
186
+ return https . get ( getHTTPOptions ( response . headers . location ) , onResponse ) ;
187
+ } else if ( status !== 200 ) {
186
188
console . log ( chalk . red ( 'ERROR' ) + ': HTTP Request Failed [%d %s]' , status , http . STATUS_CODES [ status ] ) ;
187
189
client . abort ( ) ;
188
190
process . exit ( 1 ) ;
@@ -243,7 +245,9 @@ function fetch(database, cb) {
243
245
function onResponse ( response ) {
244
246
var status = response . statusCode ;
245
247
246
- if ( status !== 200 ) {
248
+ if ( status === 301 || status === 302 || status === 303 || status === 307 || status === 308 ) {
249
+ return https . get ( getHTTPOptions ( response . headers . location ) , onResponse ) ;
250
+ } else if ( status !== 200 ) {
247
251
console . log ( chalk . red ( 'ERROR' ) + ': HTTP Request Failed [%d %s]' , status , http . STATUS_CODES [ status ] ) ;
248
252
client . abort ( ) ;
249
253
process . exit ( 1 ) ;
You can’t perform that action at this time.
0 commit comments