Skip to content

content type is wrong for the tasks data get REST API endpoint #2810

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

Closed
suryapraneeth opened this issue Feb 16, 2021 · 0 comments · Fixed by #4333
Closed

content type is wrong for the tasks data get REST API endpoint #2810

suryapraneeth opened this issue Feb 16, 2021 · 0 comments · Fixed by #4333
Assignees
Labels
bug Something isn't working

Comments

@suryapraneeth
Copy link

My actions before raising this issue

Expected Behaviour

The content type should be 'image/png' for the /tasks/{id}/data endpoint for the get request

Current Behaviour

The current content type is a list ['image/png', None] for the /tasks/{id}/data endpoint for the get request

Possible Solution

I checked the source code and this happens because mimetypes.guess_type returns the list ['image/png', None] and instead should return mimetypes.guess_type[0]

Steps to Reproduce (for bugs)

  1. access the REST API page http://localhost/api/swagger/
  2. Try the get request /tasks/{id}/data endpoint with {'type': 'frame', 'quality': 'original'}
  3. Response body is not an image instead it returns garbage data

Context

Using the API endpoint to get the frame in HTML in a href tag doesn't work because of the bad content type

Your Environment

  • Git hash commit (git log -1): a440ef2
@azhavoro azhavoro self-assigned this Feb 16, 2021
@azhavoro azhavoro added bug Something isn't working documentation Documentation should be updated labels Feb 16, 2021
@nmanovic nmanovic added this to the Backlog milestone Mar 8, 2021
@Marishka17 Marishka17 removed the documentation Documentation should be updated label Feb 11, 2022
@Marishka17 Marishka17 mentioned this issue Feb 11, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants