mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 13:45:06 +00:00
Move one-time svg mime init code into Run()
This commit is contained in:
@@ -20,7 +20,6 @@ import (
|
|||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"mime"
|
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"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)
|
apiserver.InstallServiceErrorHandler(s.Serializer, s.HandlerContainer)
|
||||||
|
|
||||||
s.installAPI(&c)
|
s.installAPI(&c)
|
||||||
|
@@ -19,6 +19,7 @@ package genericapiserver
|
|||||||
import (
|
import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"mime"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"path"
|
"path"
|
||||||
@@ -167,6 +168,13 @@ type GenericAPIServer struct {
|
|||||||
postStartHooksCalled bool
|
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.
|
// RequestContextMapper is exposed so that third party resource storage can be build in a different location.
|
||||||
// TODO refactor third party resource storage
|
// TODO refactor third party resource storage
|
||||||
func (s *GenericAPIServer) RequestContextMapper() api.RequestContextMapper {
|
func (s *GenericAPIServer) RequestContextMapper() api.RequestContextMapper {
|
||||||
|
Reference in New Issue
Block a user