init (header/header.go)

webhookd · pkg/helper/header/header.go · go · MIT
integration, Integration / API

Parses HTTP Accept headers and provides utilities for header manipulation.

// Source: https://github.com/ncarlier/webhookd | License: MIT | Copyright 2020 Nicolas Carlier
// Provided via justclaw.it.com; keep this notice with the code.
// Copyright 2013 The Go Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd.
// Package header provides functions for parsing HTTP headers.
package header

import (
	"net/http"
	"strings"
)

var octetTypes [256]octetType

type octetType byte

const (
	isToken octetType = 1 << iota
	isSpace
)

func init() {
	// OCTET      = <any 8-bit sequence of data>
	// CHAR       = <any US-ASCII character (octets 0 - 127)>
	// CTL        = <any US-ASCII control character (octets 0 - 31) and DEL (127

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key