Commit c5c7a8ffadbd51aa28a5f3f096fe43f69405da44
Prevent looping on retry after ECONNREFUSED
cel committed on 7/10/2020, 6:56:30 PMParent: d456a6cc8589489e558e6164750474ed2cfc961e
Files changed
prelude/install.js | changed |
prelude/install.js | ||
---|---|---|
@@ -47,9 +47,11 @@ | ||
47 | 47 … | }) |
48 | 48 … | } |
49 | 49 … | this.req = http.get(url, onResp).on('error', (err) => { |
50 | 50 … | // sometimes localhost resolves to 127.0.0.1 but ssb-ws listens on ::1 |
51 | - if (err.code === 'ECONNREFUSED' && err.address === '127.0.0.1') { | |
51 … | + if (err.code === 'ECONNREFUSED' && err.address === '127.0.0.1' | |
52 … | + && this.blobsBase.indexOf('localhost') > -1 | |
53 … | + ) { | |
52 | 54 … | this.blobsBase = this.blobsBase.replace('localhost', '[::1]') |
53 | 55 … | url = this.blobsBase + id |
54 | 56 … | http.get(url, onResp).on('error', (err) => { |
55 | 57 … | this.destroy(err) |
Built with git-ssb-web