Add a note about right URL syntax to the item type not recognized error

This commit is contained in:
Juhani Krekelä 2018-07-02 11:31:36 +03:00
parent 78a9e61df2
commit 7a598ce7ed
1 changed files with 1 additions and 1 deletions

View File

@ -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)