Powered by Tachyonic Project Luxon Framework v0.0.0

Luxon Framework for rapid application development. (luxon)

Version

HTTP Utilites

Forwarded Element

class luxon.utils.http.ForwardedElement[source]

Representation of Forwarded header.

Reference to RFC 7239, Section 4.

src

str – The value of the ‘for’ parameter or if the parameter is absent None. Identifies the node making the request to the proxy.

by

str – The value of the ‘by’ parameter or if the the parameter is absent None. Identifies the client-facing interface of the proxy.

host

str – The value of the ‘host’ parameter or if the parameter is absent None. Provides the host request header field as received by the proxy.

proto

str – The value of the ‘proto’ parameter or if the parameter is absent None. Indicates the protocol that was used to make the request to the proxy.

Parse Forwarded Header

luxon.utils.http.parse_forwarded_header(forwarded)[source]

Parses the value of a Forwarded header.

Parse Forwarded headers as specified by RFC 7239:

  • Check that every value has valid syntax in general.
  • Un-escapes found escape sequences.
Parameters:forwarded (str) – Value of a Forwarded header
Returns:Sequence of ForwardedElement instances.
Return type:list

Content Type Encoding

luxon.utils.http.content_type_encoding(header)[source]

Gets the encoding from Content-Type header.

Parameters:header (str) – Content-Type header value.