10000 Fix pubsubhubbub. · losingkeys/github3.py@24e5b53 · GitHub
[go: up one dir, main page]

Skip to content

Commit 24e5b53

Browse files
committed
Fix pubsubhubbub.
It shouldn't be using JSON but a form instead.
1 parent 828d9b0 commit 24e5b53

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

github3/repos.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,9 +1146,12 @@ def pubsubhubbub(self, mode, topic, callback, secret=''):
11461146
status = False
11471147
if mode and topic and callback and m:
11481148
data = [('hub.mode', mode), ('hub.topic', topic),
1149-
('hub.callback', callback), ('hub.secret', secret)]
1149+
('hub.callback', callback)]
1150+
if secret:
1151+
data.append(('hub.secret', secret))
11501152
url = self._build_url('hub')
1151-
status = self._boolean(self._post(url, data=dumps(data)), 204,
1153+
h = {'Content-Type': 'application/x-www-form-urlencoded'}
1154+
status = self._boolean(self._post(url, data=data, headers=h), 204,
11521155
404)
11531156
return status
11541157

0 commit comments

Comments
 (0)
0