From fcad3e688e43976a2605dc9492c1bc77f06f072a Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Fri, 9 Aug 2024 11:56:22 +0200 Subject: [PATCH] Fix accept_wildcard_defaults_to_json To handle possible multiple comma-separated values in Accept header --- lib/galaxy/schema/fields.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/schema/fields.py b/lib/galaxy/schema/fields.py index 46c80143d028..eb332962e0f0 100644 --- a/lib/galaxy/schema/fields.py +++ b/lib/galaxy/schema/fields.py @@ -137,7 +137,9 @@ def ModelClassField(default_value): def accept_wildcard_defaults_to_json(v): assert isinstance(v, str) - if v == "*/*": + # Accept header can have multiple comma separated values. + # If any of these values is the wildcard - we default to application/json. + if "*/*" in v: return "application/json" return v