// NoSniff applies header to protect your server from MimeType Sniffing
553109
func NoSniff() gin.HandlerFunc {
	return func(c *gin.Context) {
		c.Writer.Header().Set("X-Content-Type-Options", "nosniff")
	}
}
1155183
func httpInspectNetprofile(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error) {
	var obj NetprofileInspect
	log.Debugf("Received httpInspectNetprofile: %+v", vars)

	key := vars["key"]

	collections.netprofileMutex.Lock()
	defer collections.netprofileMutex.Unlock()
	objConfig := collections.netprofiles[key]
	if objConfig == nil {
		log.Errorf("netprofile %s not found", key)
		return nil, errors.New("netprofile not found")
	}
	obj.Config = *objConfig

	// Return the obj
	return &obj, nil
}
1336792
func NoBrowserCacheFilter(req *Request, resp *Response, chain *FilterChain) {
	resp.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate") // HTTP 1.1.
	resp.Header().Set("Pragma", "no-cache")                                   // HTTP 1.0.
	resp.Header().Set("Expires", "0")                                         // Proxies.
	chain.ProcessFilter(req, resp)
}
233378
func NetworkingFilter(fn FilterRequestFunc) {
	mutex.Lock()
	defer mutex.Unlock()
	config.NetworkingFilters = append(config.NetworkingFilters, fn)
}
1065761
func nakedEncode(dst []byte, t Type) (int, error) {
	// encode header
	return headerEncode(dst, 0, 0, nakedLen(), t)
}
632210
func filterHeader(header http.Header, filterKeys []string) (filteredHeader http.Header) {
	filteredHeader = cloneHeader(header)
	for _, key := range filterKeys {
		filteredHeader.Del(key)
	}
	return filteredHeader
}
130711
func (s *AddHeaderAction) SetHeaderName(v string) *AddHeaderAction {
	s.HeaderName = &v
	return s
}
582058
func GZIPHandlerFunc(h http.HandlerFunc, filterFn func(http.ResponseWriter, *http.Request) bool) http.HandlerFunc {
	return GZIPHandler(h, filterFn)
}
1075483
func (p *NetPlugin) InspectNameserver() ([]byte, error) {
	p.Lock()
	defer p.Unlock()
	return p.NetworkDriver.InspectNameserver()
}
219335
func DontPanicf(format string, i ...interface{}) {
	msg := fmt.Sprintf("%v\n %s", fmt.Sprintf(format, i...), debug.Stack())
	logMessage("PANIC - ", msg)
}
1333394
func NewSanicServer(apiDef *raml.APIDefinition, apiDocsDir, targetDir string, withMain bool,
	libRootURLs []string) *SanicServer {
	var prs []pythonResource
	for _, rd := range getServerResourcesDefs(apiDef) {
		pr := newResource(rd, apiDef, serverKindSanic)
		prs = append(prs, pr)
	}

	// TODO : get rid of this global variables
	globAPIDef = apiDef
	globLibRootURLs = libRootURLs

	templates := templates(serverKindSanic)

	return &SanicServer{
		APIDef:       apiDef,
		Title:        apiDef.Title,
		apiDocsDir:   apiDocsDir,
		withMain:     withMain,
		ResourcesDef: prs,
		Template:     templates,
		targetDir:    targetDir,
	}
}
257484
func (e AuthError) Headers() http.Header {
	return http.Header{
		"Content-Type":           []string{"text/plain; charset=utf-8"},
		"X-Content-Type-Options": []string{"nosniff"},
		"WWW-Authenticate":       []string{fmt.Sprintf(`Basic realm=%q`, e.Realm)},
	}
}
377021
func GetNSFunc(nsListerDeleter NamespaceListerDeleter, err error) func(*KubeConfig) (NamespaceListerDeleter, error) {
	return func(*KubeConfig) (NamespaceListerDeleter, error) {
		return nsListerDeleter, err
	}
}
569881
func (cnf *Mycnf) makeMycnf(cnfFiles []string) (string, error) {
	myTemplateSource := new(bytes.Buffer)
	myTemplateSource.WriteString("[mysqld]\n")
	for _, path := range cnfFiles {
		data, dataErr := ioutil.ReadFile(path)
		if dataErr != nil {
			return "", dataErr
		}
		myTemplateSource.WriteString("## " + path + "\n")
		myTemplateSource.Write(data)
	}
	return cnf.fillMycnfTemplate(myTemplateSource.String())
}
1178311
func (s *Sandbox) NetNsGet(nspath, name string) (*NetNs, error) {
	if err := ns.IsNSorErr(nspath); err != nil {
		return nil, ErrClosedNetNS
	}

	symlink, symlinkErr := isSymbolicLink(nspath)
	if symlinkErr != nil {
		return nil, symlinkErr
	}

	var resolvedNsPath string
	if symlink {
		path, err := os.Readlink(nspath)
		if err != nil {
			return nil, err
		}
		resolvedNsPath = path
	} else {
		resolvedNsPath = nspath
	}

	netNs, err := getNetNs(resolvedNsPath)
	if err != nil {
		return nil, err
	}

	if symlink {
		fd, err := os.Open(nspath)
		if err != nil {
			return nil, err
		}

		netNs.symlink = fd
	} else if err := netNs.SymlinkCreate(name); err != nil {
		return nil, err
	}

	return netNs, nil
}
371744
func (client *Client) CreateNatGateway(args *CreateNatGatewayArgs) (resp *CreateNatGatewayResponse, err error) {
	response := CreateNatGatewayResponse{}
	err = client.Invoke("CreateNatGateway", args, &response)
	if err != nil {
		return nil, err
	}
	return &response, err
}
985196
func httpInspectVolumeProfile(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error) {
	var obj VolumeProfileInspect
	log.Debugf("Received httpInspectVolumeProfile: %+v", vars)

	key := vars["key"]

	collections.volumeProfileMutex.Lock()
	defer collections.volumeProfileMutex.Unlock()
	objConfig := collections.volumeProfiles[key]
	if objConfig == nil {
		log.Errorf("volumeProfile %s not found", key)
		return nil, errors.New("volumeProfile not found")
	}
	obj.Config = *objConfig

	// Return the obj
	return &obj, nil
}