Skip to content

Commit

Permalink
Merge pull request #16 from dskvr/hotfix/nip11-req-url
Browse files Browse the repository at this point in the history
Fix NIP-11 request URL
  • Loading branch information
dskvr authored Oct 26, 2023
2 parents ad944c3 + c477586 commit d7d808b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nostrwatch-js",
"version": "0.0.47",
"version": "0.0.48",
"description": "js library for aggregating data from and checking the status of nostr relays",
"main": "index.js",
"type": "module",
Expand Down
5 changes: 3 additions & 2 deletions src/checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ RelayChecker.prototype.getInfo = async function(){
this.log(`timeout`, `NIP-11 info document was not returned within 10000 milliseconds`) //need to add timeout opt for info.
resolve( {} )
}, 10*1000 )
const _res = await fetch(`https://${url.hostname}/`, { method: 'GET', headers: headers})
url.protocol = "https"
const _res = await fetch(url.toString(), { method: 'GET', headers: headers})
.then(async response => {
try {
let res = await response.json()
Expand Down Expand Up @@ -592,4 +593,4 @@ RelayChecker.prototype.generateTestEvent = function(){

const [sk, pk] = generateRandomKeypair()
return signRandomEvent(sk, pk)
}
}

0 comments on commit d7d808b

Please sign in to comment.