Skip to content

Commit

Permalink
Add param validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Tcintra committed Dec 13, 2023
1 parent f1a02b6 commit eb52f94
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from flask.wrappers import Response
from flask_sqlalchemy import SQLAlchemy
from flask_compress import Compress
from werkzeug.exceptions import BadRequest
from ..db.datahandler import DataHandler
from ..configs import URI

Expand Down Expand Up @@ -58,6 +59,9 @@ def get_quotes() -> Response:
cols = request.args.get("cols", type=list)
process = request.args.get("process", True, type=bool)
include_ref_price = request.args.get("include-ref-price", False, type=bool)

if not start or not end:
raise BadRequest("start and end must be provided.")

with DataHandler() as datahandler:
try:
Expand Down

0 comments on commit eb52f94

Please sign in to comment.