summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-09-21 20:00:44 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-09-21 20:00:44 +0200
commitef8d9f8a756936578dc770a0ec275e57aa3ee51b (patch)
tree45f7aa4a12fdf8f606c522fcece01f632f2284f1 /source4
parent1ed040d8e22a63079c72126bbc896fa3c32c7f0f (diff)
downloadsamba-ef8d9f8a756936578dc770a0ec275e57aa3ee51b.tar.gz
samba-ef8d9f8a756936578dc770a0ec275e57aa3ee51b.tar.bz2
samba-ef8d9f8a756936578dc770a0ec275e57aa3ee51b.zip
Make standard SWAT script print received headers.
Diffstat (limited to 'source4')
-rw-r--r--source4/web_server/swat/__init__.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/web_server/swat/__init__.py b/source4/web_server/swat/__init__.py
index 580097186c..8229d15a3c 100644
--- a/source4/web_server/swat/__init__.py
+++ b/source4/web_server/swat/__init__.py
@@ -22,7 +22,13 @@
def __call__(environ, start_response):
status = '200 OK'
- response_headers = [('Content-type','text/plain')]
+ response_headers = [('Content-type','text/html')]
start_response(status, response_headers)
- return ['Hello world!\n']
+ yield '<table>\n'
+
+ for key, value in environ.items():
+ if isinstance(value, str):
+ yield '\t<tr><td><b>%s</b></td><td>%s</td></tr>\n' % (key, value)
+
+ yield '</table>\n'