From 7a598ce7ed94b099655fe59c6e01c29567190259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Mon, 2 Jul 2018 11:31:36 +0300 Subject: [PATCH] Add a note about right URL syntax to the item type not recognized error --- neomi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neomi.py b/neomi.py index 7cb3361..80fa764 100644 --- a/neomi.py +++ b/neomi.py @@ -685,7 +685,7 @@ class Serve(threading.Thread): if protocol == Protocol.http and itemtype is not None and itemtype not in self.config.recognised_itemtypes: # If we don't recognize the requested itemtype, signal that it was a bad request log('%s [%s] requested path %s with bad itemtype %s' % (self.address, protocol.name, path_raw, itemtype)) - reader = StringReader('%s not recognized as an item type\n\nRecognized ones are %s\n' % (itemtype, ', '.join(self.config.recognised_itemtypes))) + reader = StringReader('%s not recognized as an item type\n\nRecognized ones are %s\n\nThe correct URL syntax is http://server:port/0/textfile\n' % (itemtype, ', '.join(self.config.recognised_itemtypes))) send_header(self.sock, protocol, Status.badrequest, 'text/plain', config = self.config) send_file(self.sock, reader, protocol, 'text/plain', config = self.config)