Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with legacy mode responding with an error when it should pass #958

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

JackLewis-digirati
Copy link
Contributor

@JackLewis-digirati JackLewis-digirati commented Feb 12, 2025

This request:

{
  "origin": "https://dlcsstage-public-test-objects.s3.eu-west-1.amazonaws.com/other-video/fish.mp4",
  "mediaType": "video/mp4",
  "deliveryChannels": [
    {
      "channel": "iiif-av",
      "policy": "default-video"
    }
  ]
}

causes the below response in legacy mode:

{
  "@type": "Error",
  "statusCode": 400,
  "status": 400,
  "title": "Bad request",
  "detail": "'deliveryChannels' cannot be an empty array",
  "instance": "https://api.dlcs-stage.digirati.io/",
  "description": "'deliveryChannels' cannot be an empty array"
}

This is due to previously treating null and empty the same way when working out the delivery channels based on media type. However, this has changed with #944 where empty is treated as a 400. As such, this PR modifies the response of the LegacyConverter to correctly respond with null, rather than empty when the delivery channels cannot be worked out directly

@JackLewis-digirati JackLewis-digirati marked this pull request as ready for review February 12, 2025 17:27
@JackLewis-digirati JackLewis-digirati requested a review from a team as a code owner February 12, 2025 17:27
@JackLewis-digirati JackLewis-digirati merged commit 6b4dcbe into main Feb 13, 2025
10 checks passed
@JackLewis-digirati JackLewis-digirati deleted the fix/legacyModeWithMediaType branch February 13, 2025 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants