1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

extra check

This commit is contained in:
alexcos20 2020-09-16 06:31:40 -07:00
parent 5655909623
commit 20493dfca4

View File

@ -299,23 +299,33 @@ export class Provider extends Instantiable {
} }
<<<<<<< HEAD <<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 48cb847... extra check
/** Check for a valid provider at URL /** Check for a valid provider at URL
* @param {String} url * @param {String} url
* @return {Promise<boolean>} string * @return {Promise<boolean>} string
*/ */
<<<<<<< HEAD
======= =======
>>>>>>> 17e61d0... allow customProvider on publish >>>>>>> 17e61d0... allow customProvider on publish
=======
>>>>>>> 48cb847... extra check
public async isValidProvider(url: string): Promise<boolean> { public async isValidProvider(url: string): Promise<boolean> {
const fetch = this.ocean.utils.fetch.get(url) const fetch = this.ocean.utils.fetch.get(url)
await fetch await fetch
.then((response: Response) => { .then((response: Response) => {
if (response.ok) { if (response.ok) {
const params = response.json() const params = response.json()
<<<<<<< HEAD
<<<<<<< HEAD <<<<<<< HEAD
if (params['provider-address']) return true if (params['provider-address']) return true
======= =======
if (params) return true if (params) return true
>>>>>>> 17e61d0... allow customProvider on publish >>>>>>> 17e61d0... allow customProvider on publish
=======
if (params['provider-address']) return true
>>>>>>> 48cb847... extra check
} }
return false return false
}) })