contentSubtype must be lowercase cannot return nil
(contentSubtype string)
| 2027 | // contentSubtype must be lowercase |
| 2028 | // cannot return nil |
| 2029 | func (s *Server) getCodec(contentSubtype string) baseCodec { |
| 2030 | if s.opts.codec != nil { |
| 2031 | return s.opts.codec |
| 2032 | } |
| 2033 | if contentSubtype == "" { |
| 2034 | return getCodec(proto.Name) |
| 2035 | } |
| 2036 | codec := getCodec(contentSubtype) |
| 2037 | if codec == nil { |
| 2038 | logger.Warningf("Unsupported codec %q. Defaulting to %q for now. This will start to fail in future releases.", contentSubtype, proto.Name) |
| 2039 | return getCodec(proto.Name) |
| 2040 | } |
| 2041 | return codec |
| 2042 | } |
| 2043 | |
| 2044 | type serverKey struct{} |
| 2045 |
no test coverage detected