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:
parent
5655909623
commit
20493dfca4
@ -299,23 +299,33 @@ export class Provider extends Instantiable {
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
>>>>>>> 48cb847... extra check
|
||||
/** Check for a valid provider at URL
|
||||
* @param {String} url
|
||||
* @return {Promise<boolean>} string
|
||||
*/
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
>>>>>>> 17e61d0... allow customProvider on publish
|
||||
=======
|
||||
>>>>>>> 48cb847... extra check
|
||||
public async isValidProvider(url: string): Promise<boolean> {
|
||||
const fetch = this.ocean.utils.fetch.get(url)
|
||||
await fetch
|
||||
.then((response: Response) => {
|
||||
if (response.ok) {
|
||||
const params = response.json()
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
if (params['provider-address']) return true
|
||||
=======
|
||||
if (params) return true
|
||||
>>>>>>> 17e61d0... allow customProvider on publish
|
||||
=======
|
||||
if (params['provider-address']) return true
|
||||
>>>>>>> 48cb847... extra check
|
||||
}
|
||||
return false
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user