Skip to content

Commit

Permalink
Ensure resources is a list
Browse files Browse the repository at this point in the history
  • Loading branch information
MonsieurV committed Dec 6, 2022
1 parent 1a1f314 commit 84ffb3f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions latexonhttp/api/builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,21 @@ def compiler_latex():
if not input_spec:
return jsonify({"error": "MISSING_COMPILATION_SPECIFICATION"}), 400

# Payload validations.
# TODO Use a data validation library tu run checks?
# (Write one in Hy?)
if "resources" in input_spec:
if not isinstance(input_spec, list):
return (
jsonify(
{
"error": "INVALID_PAYLOAD_SHAPE",
"message": "resources must be a list",
}
),
400,
)

# High-level normalizsation.
logger.info(
"Before normalization %s",
Expand Down

0 comments on commit 84ffb3f

Please sign in to comment.