Skip to content

Commit fe67bdd

Browse files
committed
Merge pull request #163 from forrest-mao/fix_callback_verify_type
只有application/x-www-form-urlencoded的回调带body签名
2 parents 0f7b33c + 4d98bdb commit fe67bdd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

qiniu/auth.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ def token_of_request(self, url, body=None, content_type=None):
8989

9090
if body:
9191
mimes = [
92-
'application/x-www-form-urlencoded',
93-
'application/json'
92+
'application/x-www-form-urlencoded'
9493
]
9594
if content_type in mimes:
9695
data += body

test_qiniu.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ def test_prefetch(self):
122122
def test_fetch(self):
123123
ret, info = self.bucket.fetch('http://developer.qiniu.com/docs/v6/sdk/python-sdk.html', bucket_name, 'fetch.html')
124124
print(info)
125-
assert ret == {}
125+
assert ret['key'] == 'fetch.html'
126+
assert ret['hash'] == 'FhwVT7vs6xqs1nu_vEdo_4x4qBMB'
126127

127128
def test_stat(self):
128129
ret, info = self.bucket.stat(bucket_name, 'python-sdk.html')
@@ -256,7 +257,7 @@ def test_putWithoutKey(self):
256257
ret, info = put_data(token, None, data)
257258
print(info)
258259
assert ret is None
259-
assert info.status_code == 401 # key not match
260+
assert info.status_code == 403 # key not match
260261

261262
def test_retry(self):
262263
key = 'retry'

0 commit comments

Comments
 (0)