# WebKit 0.9.1 Release Notes

WebKit version 0.9.1 released on 04/23/06

## New Features

- Added new methods `writeMetaData()` and `writeJavaScript()` to the `Page` class that will be called by `writeHeadParts()`.
- The Examples context has now a servlet `AjaxSuggest` demonstrating the use of Ajax with Webware for Python. A baseclass `AjaxPage` and the necessary JavaScript supporting these techniques are also included in the Examples context. (Thanks to John Dickinson and Robert Forkel.)

## Improvements and Refinements

- The auto reloading app server used the `ImportSpy` module to keep track of which modules have been imported. `ImportSpy` was based on the old `ihooks` module which could raise problems with other incompatible importing mechanisms like Cheetah templates or when using zipped Python eggs. This problem has been tackled from two sides, first by replacing ihooks with new (PEP 302) import hooks if available (they were implemented in Python 2.3), and second by allowing to suppress the use of `ImportSpy` completely by setting `UseImportSpy` to False in AppServer.config. In this case, `sys.modules` will be polled regularly. The `ImportSpy` module now contains only the import hooks, the rest of the functionality for tracking and managing concurrent import has been sourced out to the new `ImportManager` module.
- The start script for RedHat/Fedora Linux has been improved. A timing issue with the "restart" option has been solved (reported by Mike Trisko).
- A `__contains__` method has been defined for session objects, so code like "`if key in session`" works as expected. As an aside, we could get complete dictionary functionality by defining `keys` and subclassing python's DictMixin. Also, consider sessions with timeout zero to be expired. (Ken Lalonde)
- Modified mod_webkit and mod_webkit2 to better agree with Python's marshal code, for a bit of speed. Unused symbols deleted, private stuff marked static. (Ken Lalonde)
- Added a new mod_webkit apache directive:

      PassHeader Foo

  will pass the incoming HTTP header `Foo`, if present, through to the AppServer. Servlets can retrieve the value like this:

      v = self.request().environ().get('Foo')

  This generalizes the If-Modified-Since hack. You can use this, for example, to to pass Pound's "X-Forwarded-For" header through, which contains the real client IP address, in order to be logged by your WebKit application. Other minor changes (all by Ken Lalonde):
  - Debug logging is compiled out by default.
  - Real errors are logged as such, not at level debug (and so invisible).
  - Zero struct `sockaddr_in` before use.
  - Plug file descriptor leak: close socket after connect failure.
  - Pass Apache's notion of the request time, rather than time(0).
  - Complain if AppServer returns garbage (mod_webkit2).
- Workaround for a bug in mod_gzip in HTTPResponse (Ken Lalonde).
- Better handling of CSS in SideBarPage (as suggested by Michael Palmer).
- Batch files mscvtk.bat have been included for building mod_webkit and mod_webkit2 under Windows using the free Microsoft Visual C++ 2003 Toolkit compiler. The mod_webkit.dll files have been updated.

## Bugfixes

- Both the monitor service and the Monitor.py script for monitoring the application server were broken and have been fixed. You need to set `EnableMonitor` to use this.
- Fixed bug in HTTP server that prevented multiple cookies from being set at the same time.
- Fixed a race condition in SessionStore (Ben Parker).
- Context and plugin paths are not correctly read in from new style config files under Windows.
- Include apr_version.h in mod_webkit.c for Apache2 (Richard Brodie).
- URL parser keeps query string when adding slash for redirect (reported by Sam Nilsson).
- Fixed a few issues in LoginPage and SecurePage (including a bug reported by Jean-Francois Pieronne).
- The exception handler now updates the linecache before printing tracebacks if the Python version is before 2.4. In newer Python versions, the traceback module automatically updates the linecache.