Skip to main content

A URL rewriting middleware that emulates a VHM url.

Project description

He’s fearsome.

About

Mr Monster is a WSGI middleware designed to make it easy to locally test pipelines that will eventually be served behind apache with a rewrite rule in place.

The configuration is very simple, a common case being:

[filter:monster]
use = egg:mr.monster#rewrite
host = www.example.com
port = 80

which simply adds the correct VirtualHostBase/Root declarations.

If no configuration options are supplied the inbound request will be introspected. To avoid this, set an explicit host and port. For users wanting to use autodetection the egg:mr.monster#rewrite line can be added directly to a pipeline.

Options

autodetect:

Pick a host and port from the inbound request.

host:

Set the canonical hostname to pass to Zope. If used you must provide a port.

port:

Set the canonical port. If used you must provide a host.

internalpath:

A path in the form /foo/site that is the base of your application in Zope.

externalpath:

A path in the form /bar/baz to filter from a request using _vh_bar syntax.

scheme:

The URI scheme to use in the virtual host, by default this is detected automatically.

Release history

2010-08-24 (1.4)

  • Add support for overriding URI scheme (Alan Hoey)

  • Make the empty string the canonical representation of SCRIPT_NAME for the reroot middleware (Matthew Wilkes)

  • Add a secondary middleware for setting the SCRIPT_NAME (Matthew Wilkes)

  • Refactor the assertion endpoint in the tests to be more like a normal WSGI app (Matthew Wilkes)

2009-08-30 (1.3)

  • Strip the external path from the passed-in path info, prevents urls like /_vh_foo/foo which manifested as fully skinned Plone sites with error messages. That made me sad. Oh yes it did. (Matthew Wilkes)

2009-08-18 (1.2)

  • Fix HTTP/1.1 autodetect in the case that the client sends a host:port for the Host header. (Matthew Wilkes)

2009-08-13 (1.1)

  • Make the case where no local config is supplied autodetect, not pass-through (Matthew Wilkes)

  • Prefer HTTP_HOST to SERVER_NAME so HTTP/1.1 clients work more reliably. (Alan Hoey)

2009-07-24 (1.0)

  • Initial release (Matthew Wilkes)

Project details


Download files

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

Source Distribution

mr.monster-1.4.tar.gz (6.5 kB view details)

Uploaded Source

File details

Details for the file mr.monster-1.4.tar.gz.

File metadata

  • Download URL: mr.monster-1.4.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mr.monster-1.4.tar.gz
Algorithm Hash digest
SHA256 4d62a9d6f914a64ba78ea568c5c3326edf5c712b39b03633abcd786e5d57bf02
MD5 75115a4a937dcb57f633dc503f3afcfb
BLAKE2b-256 661c8bd550fa7940f9717a1fe2a458ef4397c329d31f443550fc02f23fc3e61a

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