Skip to content

Commit 3d9f6ef

Browse files
authored
Merge pull request #4 from upstox/qa
Adding authorization header in webSocket similar to specs
2 parents 6334cd4 + 49ebca3 commit 3d9f6ef

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
setup(
33
name = 'upstox',
44
packages = ['upstox_api'],
5-
version = '1.4',
5+
version = '1.5',
66
include_package_data=True,
77
description = 'Official Python library for Upstox APIs',
88
author = 'Upstox Development Team',

upstox_api/api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,9 @@ def __init__(self, api_key, access_token):
251251
def start_websocket(self, run_in_background = False):
252252

253253
url = self.config['socketEndpoint'].format(api_key=self.api_key, access_token=self.access_token)
254-
self.websocket = websocket.WebSocketApp(url, on_data = self._on_data,
254+
self.websocket = websocket.WebSocketApp(url,
255+
header={'Authorization: Bearer' + self.access_token},
256+
on_data = self._on_data,
255257
on_error = self._on_error,
256258
on_close = self._on_close)
257259
if run_in_background is True:

0 commit comments

Comments
 (0)