~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to src/dispatch/__init__.py

  • Committer: mattgiuca
  • Date: 2007-12-14 04:19:50 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:60
server: Removed write to content_encoding (this is a read-only property of
    Request).
dispatch/request: Added "ensure_headers_written" and call it from init.
    This makes sure the HTTP headers are written even if there is no HTML
    header and footer and nothing else is written either.

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
    # Call the specified app with the request object
79
79
    apps.call_app(app.dir, req)
80
80
 
 
81
    # MAKE SURE we write the HTTP (and possibly HTML) header. This
 
82
    # wouldn't happen if nothing else ever got written, so we have to make
 
83
    # sure.
 
84
    req.ensure_headers_written()
 
85
 
81
86
    # When done, write out the HTML footer if the app has requested it
82
87
    if req.write_html_head_foot:
83
 
        # MAKE SURE we write the head (we would never do that if the app, nor
84
 
        # write_html_foot, ever writes anything - so just to be sure).
85
 
        req.write("", flush=0)
86
88
        html.write_html_foot(req)
87
89
 
88
90
    # Have Apache output its own HTML code if non-200 status codes were found