How to give GitHub a url with a port number when creating a webhook -


i want use github webhooks, github stripping away port number urls give it, don't work. seems new thing because used work. there way tell github keep port numbers in there?

note: i'm creating webhooks via api

i don't think port number stripped away.

post https://api.github.com/repos/my-name/my-repo/hooks 

with body:

{   "name": "web",   "active": true,   "events": [     "push",     "pull_request"   ],   "config": {     "url": "http://example.com:345/webhook",     "content_type": "json"   } } 

creates webhook:

enter image description here

btw, on page github renders url without port number.

but if click "edit" button:

enter image description here

the port number presented.

the same you'll if execute

get https://api.github.com/repos/my-name/my-repo/hooks      {     "url": "https://api.github.com/repos/my-name/my-repo/hooks/7221574",     "test_url": "https://api.github.com/repos/my-name/my-repo/hooks/7221574/test",     "ping_url": "https://api.github.com/repos/my-name/my-repo/hooks/7221574/pings",     "id": 7221574,     "name": "web",     "active": true,     "events": [       "push",      "pull_request"     ],     "config": {     "url": "http://example.com:345/webhook",     "content_type": "json"     },     "last_response": {     "code": 504,     "status": "timeout",     "message": "service timeout",     },     "updated_at": "2016-02-08t09:37:45z",     "created_at": "2016-02-08t09:37:45z"     } } 

make sure that:

  1. you post valid url
  2. body valid json
  3. you have rights create webhook
  4. you can create simple client (postman, advanced rest client)
  5. your github client library doesn't remove port number

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -