Fix request, remove done step
This commit is contained in:
parent
349e5c7488
commit
bde593b909
|
|
@ -20,10 +20,3 @@ pipeline:
|
||||||
- cd /home/hub/hub
|
- cd /home/hub/hub
|
||||||
- docker-compose pull
|
- docker-compose pull
|
||||||
- docker-compose up -d
|
- docker-compose up -d
|
||||||
|
|
||||||
done:
|
|
||||||
image: ubuntu
|
|
||||||
commands:
|
|
||||||
- sh ./deployment.sh
|
|
||||||
environment:
|
|
||||||
- PUSHBULLET_API_TOKEN=${pushbullet_api_token}
|
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,10 @@ func (handler *subscriptionHandler) handlePublish(w http.ResponseWriter, r *http
|
||||||
if subs, e := handler.Subscribers[topic]; e {
|
if subs, e := handler.Subscribers[topic]; e {
|
||||||
for _, sub := range subs {
|
for _, sub := range subs {
|
||||||
req, err := http.NewRequest("POST", sub.Callback, res.Body)
|
req, err := http.NewRequest("POST", sub.Callback, res.Body)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("While creating request to %s: %s", sub.Callback, err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
req.Header.Add("Content-Type", res.Header.Get("Content-Type"))
|
req.Header.Add("Content-Type", res.Header.Get("Content-Type"))
|
||||||
req.Header.Add("Link",
|
req.Header.Add("Link",
|
||||||
fmt.Sprintf(
|
fmt.Sprintf(
|
||||||
|
|
@ -52,7 +56,7 @@ func (handler *subscriptionHandler) handlePublish(w http.ResponseWriter, r *http
|
||||||
"https://hub.stuifzandapp.com/",
|
"https://hub.stuifzandapp.com/",
|
||||||
topic,
|
topic,
|
||||||
))
|
))
|
||||||
res, err = http.Post(sub.Callback, res.Header.Get("Content-Type"), res.Body)
|
res, err = client.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("While POSTing to %s: %s", sub.Callback, err)
|
log.Printf("While POSTing to %s: %s", sub.Callback, err)
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user