mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 05:36:12 +00:00
Move one-time svg mime init code into Run()
This commit is contained in:
@@ -20,7 +20,6 @@ import (
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"io"
|
||||
"mime"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
@@ -338,11 +337,6 @@ func (c Config) New() (*GenericAPIServer, error) {
|
||||
})
|
||||
}
|
||||
|
||||
// Send correct mime type for .svg files.
|
||||
// TODO: remove when https://github.com/golang/go/commit/21e47d831bafb59f22b1ea8098f709677ec8ce33
|
||||
// makes it into all of our supported go versions (only in v1.7.1 now).
|
||||
mime.AddExtensionType(".svg", "image/svg+xml")
|
||||
|
||||
apiserver.InstallServiceErrorHandler(s.Serializer, s.HandlerContainer)
|
||||
|
||||
s.installAPI(&c)
|
||||
|
@@ -19,6 +19,7 @@ package genericapiserver
|
||||
import (
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"mime"
|
||||
"net"
|
||||
"net/http"
|
||||
"path"
|
||||
@@ -167,6 +168,13 @@ type GenericAPIServer struct {
|
||||
postStartHooksCalled bool
|
||||
}
|
||||
|
||||
func init() {
|
||||
// Send correct mime type for .svg files.
|
||||
// TODO: remove when https://github.com/golang/go/commit/21e47d831bafb59f22b1ea8098f709677ec8ce33
|
||||
// makes it into all of our supported go versions (only in v1.7.1 now).
|
||||
mime.AddExtensionType(".svg", "image/svg+xml")
|
||||
}
|
||||
|
||||
// RequestContextMapper is exposed so that third party resource storage can be build in a different location.
|
||||
// TODO refactor third party resource storage
|
||||
func (s *GenericAPIServer) RequestContextMapper() api.RequestContextMapper {
|
||||
|
Reference in New Issue
Block a user