Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for NegotiateMediaTypeOptions (0.17 sec)

  1. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/negotiate.go

    		return MediaTypeOptions{}, false
    	}
    
    	options.Accepted = *accepts
    	return options, true
    }
    
    // NegotiateMediaTypeOptions returns the most appropriate content type given the accept header and
    // a list of alternatives along with the accepted media type parameters.
    func NegotiateMediaTypeOptions(header string, accepted []runtime.SerializerInfo, endpoint EndpointRestrictions) (MediaTypeOptions, bool) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Oct 10 10:53:34 UTC 2019
    - 9.5K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/wrapper.go

    }
    
    func (wrapped *WrappedHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
    	if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.AggregatedDiscoveryEndpoint) {
    		mediaType, _ := negotiation.NegotiateMediaTypeOptions(req.Header.Get("Accept"), wrapped.s.SupportedMediaTypes(), DiscoveryEndpointRestrictions)
    		// mediaType.Convert looks at the request accept headers and is used to control whether the discovery document will be aggregated.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 01 18:15:22 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/negotiate_test.go

    }
    
    func BenchmarkNegotiateMediaTypeOptions(b *testing.B) {
    	accepted := fakeSerializerInfoSlice()
    	header := "application/vnd.kubernetes.protobuf,*/*"
    
    	for i := 0; i < b.N; i++ {
    		options, _ := NegotiateMediaTypeOptions(header, accepted, DefaultEndpointRestrictions)
    		if options.Accepted != accepted[1] {
    			b.Errorf("Unexpected result")
    		}
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Oct 10 10:53:34 UTC 2019
    - 9K bytes
    - Viewed (0)
Back to top