Skip to content

Commit 402275f

Browse files
authored
Fixed update if ngrok is restarted and re-run
1 parent 8530344 commit 402275f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/ngrokwebhook.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def findwebhookidbyname(api, webhookname):
5656
ngrokjson = re.search('JSON.parse\(\"(.+)\"\)\;',line).group(1)
5757
ngrokjson = (ngrokjson.replace('\\',''))
5858
print (ngrokjson)
59-
targetUrl = (json.loads(ngrokjson)["Session"]["Tunnels"]["command_line (http)"]["URL"])+url_suffix
59+
Url = (json.loads(ngrokjson)["Session"]["Tunnels"]["command_line (http)"]["URL"])+url_suffix
6060
print (targetUrl)
6161

6262
#check if the webhook exists by name and then create it if not
@@ -70,5 +70,5 @@ def findwebhookidbyname(api, webhookname):
7070
else:
7171
#update
7272
print (whid)
73-
dict=api.webhooks.update(whid, webhookname, targetUrl) #not working yet
73+
dict=api.webhooks.update(whid, name=webhookname, targetUrl=Url)
7474
print (dict)

0 commit comments

Comments
 (0)