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

Vendorize "github.com/minio/minio/pkg/mimedb" to use its content-type resolutions #2563

Merged
merged 1 commit into from
Oct 3, 2018

Conversation

Praveenrajmani
Copy link
Collaborator

minio/mimedb does not take os-shipped mimetypes. So that the content-type resolutions are
standardized across cross plaforms.

Fixes #2559

@nitisht nitisht requested review from nitisht, kannappanr and sinhaashish and removed request for nitisht October 1, 2018 07:20
@codecov
Copy link

codecov bot commented Oct 1, 2018

Codecov Report

Merging #2563 into master will increase coverage by 0.03%.
The diff coverage is 25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2563      +/-   ##
==========================================
+ Coverage   10.46%   10.49%   +0.03%     
==========================================
  Files         107      107              
  Lines       10831    10828       -3     
==========================================
+ Hits         1133     1136       +3     
+ Misses       9547     9542       -5     
+ Partials      151      150       -1
Impacted Files Coverage Δ
cmd/select-main.go 0% <0%> (ø) ⬆️
cmd/client-s3.go 13.38% <0%> (ø) ⬆️
cmd/client-url.go 68.11% <100%> (-0.68%) ⬇️
cmd/pipechan.go 100% <0%> (+14.63%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7260b0f...01297f5. Read the comment docs.

@@ -228,7 +228,12 @@ func isURLPrefixExists(urlPrefix string, incomplete bool) bool {
// on failure just return 'application/octet-stream'.
func guessURLContentType(urlStr string) string {
url := newClientURL(urlStr)
contentType := mime.TypeByExtension(filepath.Ext(url.Path))
var contentType string
if objectExt := filepath.Ext(url.Path); objectExt != "" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you create a function similar to mimedb.TypeByExtension? it would be better original package has this function. This can help avoid the large modifications on the mc end, making sure that mimedb is a drop in replacement for mime package.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok . Will send a PR to minio/minio and then re-vendorize this

@kannappanr
Copy link
Collaborator

Marked blocked per discussion in this PR.

@Praveenrajmani
Copy link
Collaborator Author

vendor updated and the PR is ready for review

Copy link
Member

@harshavardhana harshavardhana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything else is super neat.

@@ -0,0 +1,17 @@
# Generate db.go from db.json downloaded nodejs mime-db project.
# NOTE: Autogenerated db.go needs to be vet proofed. \
Manually edit json -> JSON for all variable names
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need to vendorize this, ignore this from git reset HEAD^ vendor/github.com/minio/minio/pkg/mimedb/Makefile and ammend.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

The content-type resolutions are standardized across platforms.

Fixes minio#2559
@deekoder deekoder merged commit 449cad0 into minio:master Oct 3, 2018
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.

4 participants