Project

Profile

Help

Issue #5507

closed

content-app always sets Content-Type header to 'application/octet-stream'

Added by dkliban@redhat.com over 4 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 60
Quarter:

Description

The FileResponse from aiohttp tries to guess the content type by looking at the extension of the filename. The content-app is always handing the FileResponse object an Artifact file that doesn't have an extension. As a result the Content-Type cannot be inferred.

We should manually mimetypes.guesstype[0] function that aiohttp already uses for guessing the content type, but pass it the 'relative_path' from the content artifact. We can then use the values returned as parameters for FileResponse object.

[0] https://docs.python.org/3.6/library/mimetypes.html#mimetypes.guess_type

Actions #1

Updated by dkliban@redhat.com over 4 years ago

  • Description updated (diff)
Actions #2

Updated by dkliban@redhat.com over 4 years ago

  • Description updated (diff)
Actions #3

Updated by dkliban@redhat.com over 4 years ago

  • Status changed from NEW to POST
  • Sprint set to Sprint 59
Actions #4

Updated by dkliban@redhat.com over 4 years ago

  • Triaged changed from No to Yes

Added by dkliban@redhat.com over 4 years ago

Revision 9df8b2b9 | View on GitHub

Set Content-Type and Content-Encoding headers in content-app responses

closes: #5507 https://pulp.plan.io/issues/5507

Added by dkliban@redhat.com over 4 years ago

Revision 9a597243 | View on GitHub

Set Content-Type and Content-Encoding headers for StreamedResponse

closes: #5507 https://pulp.plan.io/issues/5507

Actions #5

Updated by rchan over 4 years ago

  • Sprint changed from Sprint 59 to Sprint 60
Actions #6

Updated by dkliban@redhat.com over 4 years ago

  • Status changed from POST to MODIFIED
Actions #8

Updated by bmbouter over 4 years ago

  • Sprint/Milestone set to 3.0.0
Actions #9

Updated by bmbouter over 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF