Skip to content

Commit a219e51

Browse files
authored
Merge pull request #516 from jacksec-engineer/finding-autofix-37eeb6f0
fix(code-quality): Fix for Explicit returns mixed with implicit (fall through) returns
2 parents 2c610d9 + 4d8f4d6 commit a219e51

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

app/app.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ def input_url():
115115
elif message is not None:
116116
# 500 error returned for database failure
117117
abort(HTTPStatus.INTERNAL_SERVER_ERROR)
118+
return None
118119

119120
# Return link page with URL if successful
120121
resp = make_response(
@@ -187,8 +188,7 @@ def redirect_url(arg):
187188
hashsum = hashlib.sha256(requested_path.encode("utf-8")).hexdigest()
188189
url_bytes, salt_bytes = db.get_link(hashsum)
189190
if url_bytes is False:
190-
abort(HTTPStatus.NOT_FOUND)
191-
return None
191+
return page_not_found(HTTPStatus.NOT_FOUND)
192192
else:
193193
db.increment_click(hashsum)
194194
newlink = urls.decrypt_url(
@@ -199,6 +199,8 @@ def redirect_url(arg):
199199
)
200200
return resp
201201

202+
return internal_server_error(HTTPStatus.INTERNAL_SERVER_ERROR)
203+
202204

203205
@application.after_request
204206
def add_security_headers(resp):

0 commit comments

Comments
 (0)