Skip to content

v1.0.1rc3-1

Pre-release
Pre-release
Compare
Choose a tag to compare
@Torxed Torxed released this 14 Jul 08:54
· 53 commits to master since this release

New features:

  • vhost in configuration now supports one new (and one stub) function. if a vhost configuration contains "module" : "/path/script.py", that script will be imported and executed upon each request (no caching for now). It has two "lookups" in terms of module function, one being on_request which will be used as the default for each request to that vhost. Unless @slimHTTP.instances['addr:port'].route('/', vhost='example.com') is specified, which will override the default handler on_request. If none of the two are found, the module is simply just executed as-is and whatever is in there will act as a normal Python script.

  • HTTPS support - better late than never. HTTPS is tested without PyOpenSSL which is an optional enhancement to slimHTTP. Mockup function to simulate the function calls to PyOpenSSL has been created, so a direct replacement of ssl to PyOpenSSL.SSL should be possible.

  • index_file no longer have precedence over @app.route definitions, those definitions there for no longer require /index.html at the end, and routes can be either @app.route('/') or @app.route('/index.html') - but the later will not be auto-redirected if the client doesn't specify it.

Fixes

This commit also addresses issue #8. But extensive testing hasn't been done.