-
Notifications
You must be signed in to change notification settings - Fork 553
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
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
cmd/client-url.go
Outdated
@@ -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 != "" { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Marked blocked per discussion in this PR. |
f15cfa7
to
559f711
Compare
vendor updated and the PR is ready for review |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
559f711
to
01297f5
Compare
minio/mimedb
does not take os-shipped mimetypes. So that the content-type resolutions arestandardized across cross plaforms.
Fixes #2559