Skip to content

Commit 9f772ce

Browse files
committed
Checking for whether an existing file was provided. RE:natcap#1580
1 parent 21f08a9 commit 9f772ce

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

codesigning/gcp-cloudfunc/main.py

+3
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ def main(request):
109109
mday, mmonth, myear = response.headers['Last-Modified'].split(' ')[1:4]
110110
modified_time = datetime.datetime.strptime(
111111
' '.join((mday, mmonth, myear)), '%d %b %Y')
112+
if response.status_code > 400:
113+
return jsonify('Requested file does not exist'), 403
114+
112115
if modified_time < datetime.datetime(year=2024, month=6, day=1):
113116
return jsonify('File is too old'), 400
114117

0 commit comments

Comments
 (0)