Skip to content

Commit

Permalink
Fix accept_wildcard_defaults_to_json
Browse files Browse the repository at this point in the history
To handle possible multiple comma-separated values in Accept header
  • Loading branch information
davelopez committed Aug 9, 2024
1 parent 3fa8741 commit aa33d29
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/galaxy/schema/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit aa33d29

Please sign in to comment.