Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Owo Sugiana
/
opensipkd-jsonrpc
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b4fa5e38
authored
Mar 26, 2021
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Bug fixed get_header() saat Py3
1 parent
451ae504
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
opensipkd/jsonrpc/__init__.py
opensipkd/jsonrpc/auth.py
opensipkd/jsonrpc/__init__.py
View file @
b4fa5e3
...
@@ -6,4 +6,5 @@ def get_random_number(width=12):
...
@@ -6,4 +6,5 @@ def get_random_number(width=12):
def
get_jsonrpc
(
method
,
params
):
def
get_jsonrpc
(
method
,
params
):
return
dict
(
jsonrpc
=
'2.0'
,
method
=
method
,
params
=
params
,
id
=
get_random_number
(
6
))
n
=
get_random_number
(
6
)
return
dict
(
jsonrpc
=
'2.0'
,
method
=
method
,
params
=
params
,
id
=
n
)
opensipkd/jsonrpc/auth.py
View file @
b4fa5e3
...
@@ -33,7 +33,7 @@ def get_header(userid, password, time_stamp):
...
@@ -33,7 +33,7 @@ def get_header(userid, password, time_stamp):
else
:
else
:
s
=
base64
.
encodebytes
(
signature
)
s
=
base64
.
encodebytes
(
signature
)
if
isinstance
(
s
,
bytes
):
if
isinstance
(
s
,
bytes
):
s
=
s
tr
(
s
)
s
=
s
.
decode
(
)
s
=
s
.
replace
(
'
\n
'
,
''
)
s
=
s
.
replace
(
'
\n
'
,
''
)
return
dict
(
userid
=
userid
,
signature
=
s
,
key
=
time_stamp
)
return
dict
(
userid
=
userid
,
signature
=
s
,
key
=
time_stamp
)
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment