Skip to main content

A middleware for proper handling of HEAD requests.

Project description

guillotine is a WSGI middleware which allows for HEAD requests to be properly handled by your WSGI pipeline. guillotine is intended to be placed as the first, or topmost component in a WSGI pipeline, such that all other middelware is downstream. For an incoming request, guillotine converts the request method from ‘HEAD’ to ‘GET’ before handing the request off to the next downstream middleware or application. guillotine then takes responsiblity for discarding the response body before returning to the application server.

For more information about why you might want to do this see Graham Dumpleton’s article, WSGI issues with HTTP HEAD requests.

Using guillotine with Paster

guillotine provides an entry point for Paster allowing it to be used as a middleware in a pipeline:

[pipeline:example_app]
pipeline =
    egg:guillotine#guillotine
    egg:example#some_middleware
    example_app

Using guillotine “by hand”

If you compose your WSGI pipeline in Python code, guillotine can be constructed directly:

from guillotine import Guillotine

middleware = Guillotine(app)  # app is some WSGI application or pipeline

0.1 (2011-05-20)

  • Initial release.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

guillotine-0.1.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file guillotine-0.1.tar.gz.

File metadata

  • Download URL: guillotine-0.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for guillotine-0.1.tar.gz
Algorithm Hash digest
SHA256 d1441b6ed4126daffacd68e876778b9871eb75944f19ab8a02944858752a2ae4
MD5 61732c2e9f04f45022bbada0c4c2407d
BLAKE2b-256 67fa40f27b48a552ff7655789bf7dfcf413b55db5981ba8f066ac1dee9ccceef

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page