Kiss Headers Versions Save

Python package for HTTP/1.1 style headers. Parse headers to objects. Most advanced available structure for http headers.

2.2.0

4 years ago

Changes:

  • Improvement: Implement insert() method on Headers class.
  • Feature: Introducing the Attributes class in models. Attributes/members are now ordered by default.
  • Improvement: Add pop() and insert() methods on Header class.
  • Bugfix: Unescape the double quote char in the cookie value when using SetCokies or Cookie classes.
  • Improvement: Implement valued_attrs property on Header to extract a list of distinct attributes that have at least one value attached to them.

The biggest improvement is that the Header class now acts ordered on its members and attributes/keys/values. See PR #32

The package will most likely go into feature freeze until 3.0-dev. The current focus will be around tests/docs and issues addressed. Enjoy 🎉 Thank all present and future adopters.

Docs are going to be updated soon.

2.1.2

4 years ago

Changes:

  • Bugfix: dir method in Header instance could contain entries with illegal characters.
  • Documentation: Major update available at kiss-headers.tech
  • Bugfix: Allow set item value to contain comma-separated entries in Headers.
  • Bugfix: pop() method on Headers was discarding output_lock_type() toggle.
  • Feature: Introducing index() method on Headers class. Behave like list().index().
  • Bugfix: ContentDisposition was rejecting perfectly valid non-ASCII filename.
  • Improvement: Add ready-to-use methods in ContentDisposition class.
  • Improvement: Creates py.typed file. #29
  • Others: Docstring improvements.

2.1.1

4 years ago

Changes :

  • Bugfix: Disallow single colon in username when using BasicAuth.
  • Add: Create ContentSecurityPolicy custom header in builder.py.
  • Improvement: Add ready-to-use methods in Authorization, BasicAuthorization, AltSvc, StrictTransportSecurity, ContentSecurityPolicy, WwwAuthenticate and ContentRange.
  • Improvement: Adjust/Add get_qualifier() method when needed in builder.py.

2.1.0

4 years ago

Changes :

  • Feature : Polymorphism, transform a Header object to its corresponding subclass. #26
  • Feature : Implement pop() and popitem() methods in Headers.
  • Bugfix : Discard multiple entries detection if the header is 'Subject'.
  • Bugfix : Acknowledge the folding LF + 1 space technique to unfold.
  • Add : Cookie custom header class in builder.py.
  • Bugfix : Fix how WwwAuthenticate custom header is built.
  • Feature: Add unfolded_content property to Header class.
  • Other : Provide scripts for developers. #24

2.0.5

4 years ago

Changes : #22 #21 #20

  • Feature : Retrieve comments in header content using newly created comments property on Header.
  • Feature : Parse headers that are UTF-8 encoded when using parse_it() function with bytes.
  • Feature : Attribute value in header are unfolded by default when retrieving it. content property is not altered.
  • Other : Minor code simplification in Header class. Remove redundant private member.

2.0.4

4 years ago

Changes :

  • Feature : Add method has_many() to verify if an header or attribute name has multiple entries associated.
  • Improvement : Allow class that inherit from CustomHeader to override their header name.
  • Feature : Add BasicAuthorization in the ready-to-use headers objects.
  • Bugfix : Implement bool method for Headers class to act like list() does.

2.0.3

4 years ago

Changes :

  • Bugfix : Better detection of an illegal header name.
  • Improvement : parse_it() was too permissive and allowed illegal header name to be included.
  • Feature : Reversed can now be called upon an Headers instance.
  • Feature : Sorted can be used with an Headers instance to return a list of Header in alphabetical order.
  • Bugfix : ContentDisposition custom class was not encoding fallback filename properly.
  • Improvement : Headers class can be instantiated like Headers(Header("Content-Type", "text/html"), Header("Allow", "POST")).

2.0.2

4 years ago

Changes :

  • Bugfix : Support for (yet unreleased) Python 3.9
  • Other : Disallow illegal header name when using Header class.

Also a few improvements in the code struct. 👍

2.0.1

4 years ago

This is a minor release, ship bugfixes.

Changes :

  • Bugfix : Using CR+LF instead of LF when using repr of Headers #13
  • Bugfix : Removing member from an Header may left trailing spaces or a unneeded coma #15

2.0.0

4 years ago

Changes : PR #11

  • Bugfix : Prevent add a semicolon if this is the first entry when doing header+="preload" # "; preload".
  • Feature : Implement the possibility to invoke '+' and '-' operator on Header and string.
  • Feature : Introducing the builder. 40+ ready-to-use classes fully documented to create on-the-fly headers.
  • Improvement : The structure of the package has been changed.
  • Feature : Support email.Message object in the parse_it() function.
  • Feature : Support for parsing urllib3.HTTPResponse in parse_it()
  • Minor : Add Alt_Svc header hint on Headers class for autocompletion in IDEs.
  • Feature/Improvement : Introduce the capability of detecting multiple entries in content for a single header.
  • Bugfix : Header names were not kept in order when using keys() method of Headers object.
  • Bugfix : Cmp header to another header object is now expected to behave correctly.
  • Feature : Introduce explain() function that take an Headers object and output a dict containing explanation, if available, of each entry.
  • Bugfix : eq method of Headers and Header classes should raise the proper exception now. NotImplementedError instead of NotImplemented eg. not callable.
  • Bugfix : Properly unquote member(s) of an Header object.

Docs are on their way 👍