Fix URL to plugins and default page charset in HTTP server.

This commit is contained in:
Valentin Lorentz 2011-10-02 12:11:30 +02:00
parent 4e658bbdec
commit a46176e3b1
2 changed files with 5 additions and 5 deletions

View File

@ -130,8 +130,8 @@ class SupyHTTPServerCallback:
neither overriden this message or defined an handler for this query.""") neither overriden this message or defined an handler for this query.""")
def doGet(self, handler, path, *args, **kwargs): def doGet(self, handler, path, *args, **kwargs):
handler.send_response(400) handler.send_response(404)
self.send_header('Content_type', 'text/plain') self.send_header('Content_type', 'text/plain; charset=utf-8')
self.send_header('Content-Length', len(self.defaultResponse)) self.send_header('Content-Length', len(self.defaultResponse))
self.end_headers() self.end_headers()
self.wfile.write(self.defaultResponse) self.wfile.write(self.defaultResponse)
@ -152,7 +152,7 @@ class Supy404(SupyHTTPServerCallback):
trained to help you in such a case.""") trained to help you in such a case.""")
def doGet(self, handler, path, *args, **kwargs): def doGet(self, handler, path, *args, **kwargs):
handler.send_response(404) handler.send_response(404)
self.send_header('Content_type', 'text/plain') self.send_header('Content_type', 'text/plain; charset=utf-8')
self.send_header('Content-Length', len(self.response)) self.send_header('Content-Length', len(self.response))
self.end_headers() self.end_headers()
self.wfile.write(self.response) self.wfile.write(self.response)
@ -181,7 +181,7 @@ class SupyIndex(SupyHTTPServerCallback):
plugins = _('No plugins available.') plugins = _('No plugins available.')
else: else:
plugins = '<ul><li>%s</li></ul>' % '</li><li>'.join( plugins = '<ul><li>%s</li></ul>' % '</li><li>'.join(
['<a href="/%s">%s</a>' % (x,y.name) for x,y in plugins]) ['<a href="/%s/">%s</a>' % (x,y.name) for x,y in plugins])
response = self.template % plugins response = self.template % plugins
handler.send_response(200) handler.send_response(200)
self.send_header('Content_type', 'text/html') self.send_header('Content_type', 'text/html')

View File

@ -1,3 +1,3 @@
"""stick the various versioning attributes in here, so we only have to change """stick the various versioning attributes in here, so we only have to change
them once.""" them once."""
version = '0.83.4.1+limnoria (2011-09-18T10:31:09+0200)' version = '0.83.4.1+limnoria (2011-10-02T12:11:30+0200)'