mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-12 05:02:32 +01:00
httpserver: Hide well-known callback from the index
Closes GH-1460.
This commit is contained in:
parent
2e2c243b8b
commit
698dfc2fca
@ -240,6 +240,8 @@ class SupyHTTPServerCallback(log.Firewalled):
|
||||
|
||||
fullpath = False
|
||||
name = "Unnamed plugin"
|
||||
public = True
|
||||
"""Whether the callback should be listed in the root index."""
|
||||
defaultResponse = _("""
|
||||
This is a default response of the Supybot HTTP server. If you see this
|
||||
message, it probably means you are developing a plugin, and you have
|
||||
@ -307,7 +309,10 @@ class SupyIndex(SupyHTTPServerCallback):
|
||||
name = "index"
|
||||
defaultResponse = _("Request not handled.")
|
||||
def doGetOrHead(self, handler, path, write_content):
|
||||
plugins = [x for x in handler.server.callbacks.items()]
|
||||
plugins = [
|
||||
(name, cb)
|
||||
for (name, cb) in handler.server.callbacks.items()
|
||||
if cb.public]
|
||||
if plugins == []:
|
||||
plugins = _('No plugins available.')
|
||||
else:
|
||||
@ -384,6 +389,7 @@ class SupyWellKnown(SupyHTTPServerCallback):
|
||||
"""Serves /.well-known/ resources."""
|
||||
name = 'well-known'
|
||||
defaultResponse = _('Request not handled')
|
||||
public = False
|
||||
|
||||
def doGetOrHead(self, handler, path, write_content):
|
||||
for callback in handler.server.callbacks.values():
|
||||
|
Loading…
Reference in New Issue
Block a user