Skip to content

Commit 719cf89

Browse files
committed
Expect Auspice JSON to start with "{"
1 parent d415fd4 commit 719cf89

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/galaxy/datatypes/text.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,13 +736,13 @@ def sniff_prefix(self, file_prefix: FilePrefix) -> bool:
736736

737737
def _looks_like_is_auspicejson(self, file_prefix: FilePrefix, load_size: int = 20000) -> bool:
738738
"""
739-
Expects 'meta', 'tree', and 'nodes' to be present as keys in the JSON structure.
739+
Expects JSON to start with { and 'meta', 'tree', 'updated' and 'nodes' to be present as keys in the JSON structure.
740740
"""
741741
try:
742742
with open(file_prefix.filename) as fh:
743743
segment_str = fh.read(load_size)
744744

745-
if all(x in segment_str for x in ["version", "meta", "updated", "panels"]):
745+
if segment_str.startswith('{') and all(x in segment_str for x in ["version", "meta", "updated", "panels"]):
746746
return True
747747
except Exception:
748748
pass

0 commit comments

Comments
 (0)