Skip to content

Commit 416d30a

Browse files
committed
fix access to non existing backup index
1 parent e45f8ff commit 416d30a

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

otsserver/rpc.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,16 @@ def get_tip(self):
7171

7272
def get_backup(self):
7373
chunk = self.path[len('/experimental/backup/'):]
74+
result = b''
7475
try:
7576
chunk = int(chunk)
77+
result = self.backup[chunk]
7678
except:
7779
self.send_response(404)
7880
self.send_header('Content-type', 'text/plain')
7981
self.end_headers()
8082
return
8183

82-
result = self.backup[chunk]
83-
84-
if result is None:
85-
self.send_response(404)
86-
self.send_header('Content-type', 'text/plain')
87-
self.end_headers()
88-
return
89-
9084
self.send_response(200)
9185
self.send_header('Content-type', 'application/octet-stream')
9286
self.send_header('Cache-Control', 'public, max-age=31536000')

0 commit comments

Comments
 (0)