forked from mtusi2026/mtusi2026lab7
some changes
This commit is contained in:
@@ -33,6 +33,9 @@ def main():
|
||||
c.call('POST','/api/v1/chats/'+other['id']+'/messages',404,actor=eve,
|
||||
headers={'X-User-Id':alice['id'],'Idempotency-Key':uuid.uuid4().hex},
|
||||
body={'text':'','attachment_ids':[att['id']]})
|
||||
oversized = c.call('POST','/api/v1/chats/'+chat['id']+'/attachments?filename=large.png',
|
||||
413, actor=alice, raw=b'', headers={'Content-Type':'image/png','Content-Length':'10485761'})
|
||||
check(oversized['json']['error']['code']=='payload_too_large','unexpected body limit error')
|
||||
for _ in range(80):
|
||||
r=c.call('POST','/api/v1/auth/sessions',[401,429])
|
||||
if r['status']==429:
|
||||
@@ -40,6 +43,6 @@ def main():
|
||||
break
|
||||
else:
|
||||
raise AssertionError('Login throttle did not activate')
|
||||
print('PASS: hostname, foreign attachment and ingress rate limit')
|
||||
print('PASS: hostname, foreign attachment, request size and ingress rate limit')
|
||||
if __name__=='__main__':
|
||||
run(main)
|
||||
|
||||
Reference in New Issue
Block a user