Skip to content

Commit

Permalink
Send 400 when Redmine URI does not start with HTTPS
Browse files Browse the repository at this point in the history
  • Loading branch information
penguineer committed Mar 10, 2020
1 parent 8528774 commit 1c2e022
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ def get(self):
redmineurl = self.get_argument('url', None)
if redmineurl is None or redmineurl == '':
raise tornado.web.HTTPError(status_code=400, reason="Redmine URL must not be empty")
if not redmineurl.lower().startswith("https"):
raise tornado.web.HTTPError(status_code=400, reason="Redmine URL must start with 'HTTPS'")
apikey = self.get_argument('apikey', None)
if apikey is None or apikey == '':
raise tornado.web.HTTPError(status_code=400, reason="API key URL must not be empty")
Expand Down

0 comments on commit 1c2e022

Please sign in to comment.