[#188] Improve content-type detector #189
No reviewers
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-http-gw#189
Loading…
Reference in a new issue
No description provided.
Delete branch "KurlesHS/frostfs-http-gw:feat/improve_content_type_detector"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I looked at several libraries that guess the content type from the content, but none of them correctly identified either the
text/css
ortext/javascript
content type.I also investigated how the rclone utility and the MinIO server determine the type of content. Both of these software first pay attention to the
content-type
header. If it's missing, they set the content type by file extension.In our case, I decided to combine both methods. First, we will attempt to determine the content type based on the content itself. If the content appears to be
text/plain
, we will then use the file extension to determine the exact type of content.Signed-off-by: Aleksey Kravchenko al.kravchenko@yadro.com
LGTM
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.