WIP: Serve LFS/attachment with http.ServeContent to Support Range-Request#20480
WIP: Serve LFS/attachment with http.ServeContent to Support Range-Request#204806543 wants to merge 13 commits into
Conversation
| func (ct SniffedType) Mime() string { | ||
| return strings.Split(ct.contentType, ";")[0] | ||
| } | ||
|
|
There was a problem hiding this comment.
Note to self: this is a better version than I have in #20464, will incorporate there.
There was a problem hiding this comment.
we should use SplitN so go can skip split after first ; ... just some tiny optimization nits
There was a problem hiding this comment.
@silverwind I'm going to delete the mime stuff as it's unrelated to the pull topic! - so feel free to pick it for your pull :)
There was a problem hiding this comment.
sure, for reference, code was:
func (ct SniffedType) Mime() string {
return strings.Split(ct.contentType, ";")[0]
}There was a problem hiding this comment.
If we are talking about micro-optimization, str[:strings.Index(str, ";")] should be even faster than SplitN I think :)
Edit: Done, added it as GetMimeType in #20484.
| // Mime return the mime | ||
| func (ct SniffedType) Mime() string { | ||
| return strings.Split(ct.contentType, ";")[0] | ||
| } | ||
|
|
There was a problem hiding this comment.
| // Mime return the mime | |
| func (ct SniffedType) Mime() string { | |
| return strings.Split(ct.contentType, ";")[0] | |
| } |
Delete as discussed, it's unused.
| return err | ||
| } | ||
|
|
||
| func setCommonHeaders(ctx *context.Context, name string, data interface{}) error { |
There was a problem hiding this comment.
Not sure this additional function is of any benefit. Cache header can be set like in #20484 via httpcache module.
|
-> Make repository response support HTTP range request #24592 |
take #18448 and finish it ...