File: doc.go

package info (click to toggle)
golang-github-muhlemmer-httpforwarded 0.1.0-2~bpo12%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-backports
  • size: 116 kB
  • sloc: makefile: 2
file content (21 lines) | stat: -rw-r--r-- 869 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright 2016 Tim Heckman. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Package httpforwarded is a helper package for parsing the Forwarded HTTP
// header as defined in RFC-7239 [1]. There is a function for parsing the value
// of multiple Forwarded headers, and a function for formatting a Forwarded
// header.
//
// Because an HTTP request can have multiple Forwarded headers with unique
// fields, we need to support parsing and joining of all of them in the order
// they are provided.
//
// Here is an example of parsing the Forwarded header:
//
// 		// var req *http.Request
//		vals := req.Header[http.CanonicalHeaderKey("forwarded")] // get all Forwarded fields
//		params, _ := httpforwarded.Parse(vals)
//
// [1] https://tools.ietf.org/html/rfc7239
package httpforwarded