Implement --no-server-id

Suggested by: T.Ramirez
This commit is contained in:
Emil Mikulic
2013-04-29 00:55:08 +10:00
parent ccf0dbd809
commit 5a0291f47e
4 changed files with 73 additions and 26 deletions

16
devel/test_server_id.py Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env python
import unittest
from test import TestHelper, Conn, parse
class TestForward(TestHelper):
def test_no_server_id(self):
resp = Conn().get("/", method = 'BOGUS')
status, hdrs, body = parse(resp)
self.assertContains(status, "400 Bad Request")
self.assertFalse(hdrs.has_key("Server"))
self.assertFalse("Generated by darkhttpd/" in body)
if __name__ == '__main__':
unittest.main()
# vim:set ts=4 sw=4 et: