component-basek8s.io/component-base/zpages/httputil Index | Files

package httputil

import "k8s.io/component-base/zpages/httputil"

Index

Variables

var ErrUnsupportedMediaType = fmt.Errorf("media type not acceptable, must be: text/plain")

ErrUnsupportedMediaType is the error returned when the request's Accept header does not contain "text/plain".

Functions

func AcceptableMediaType

func AcceptableMediaType(r *http.Request) bool

AcceptableMediaType checks if the request's Accept header contains a supported media type with optional "charset=utf-8" parameter.

Source Files

httputil.go

Version
v0.33.0 (latest)
Published
Apr 23, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
4 hours ago

Tools for package owners.