File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -157,17 +157,20 @@ const testUrl = async url => {
157157 try {
158158 resp = await fetch ( url , { signal : controller . signal } ) ;
159159 } catch ( err ) {
160- if ( err . name === "AbortError" ) return "Failed due to time out after 5s"
161- return `Failed during request with error '${ err } '`
160+ if ( err . name === "AbortError" ) return "Failed due to time out after 5s" ;
161+ return `Failed during request with error '${ err } '` ;
162162 } finally {
163163 clearTimeout ( timer ) ;
164164 }
165165 if ( ! resp . ok ) {
166- return `Failed with status code '${ resp . status } ${ resp . statusText } '`
166+ return `Failed with status code '${ resp . status } ${ resp . statusText } '` ;
167+ }
168+ if ( resp . redirected ) {
169+ return `Failed due to automatic redirect to '${ resp . url } '` ;
167170 }
168171 const text = await resp . text ( ) ;
169172 if ( text . toLowerCase ( ) . trim ( ) === "" ) {
170- return `Failed with empty return body (status '${ resp . status } ${ resp . statusText } ')`
173+ return `Failed with empty return body (status '${ resp . status } ${ resp . statusText } ')` ;
171174 }
172175} ;
173176
You can’t perform that action at this time.
0 commit comments