fix 404 to the modern system

marnanel-wip
Marnanel Thurman 2023-11-06 01:26:15 +00:00
rodzic de8ca26303
commit fb9fe9aaa7
2 zmienionych plików z 4 dodań i 10 usunięć

Wyświetl plik

@ -28,12 +28,6 @@ NODEINFO_PART_2_URI = '/nodeinfo.json'
WEBFINGER_URI = '/.well-known/webfinger'
WEBFINGER_MIMETYPE = 'application/jrd+json; charset=utf-8'
ERROR_404 = """Content-Type: text/html
Status: 404 Not found
That resource does not exist here.
"""
DEFAULT_HOST = 'localhost'
DEFAULT_PORT = 17177
@ -77,7 +71,6 @@ Status: 200 OK
Hello world.
"""
return result
def despatch_host_meta(env, match):
@ -86,7 +79,7 @@ def despatch_host_meta(env, match):
result = {
'mimetype': CONTENTTYPE_HOST_META,
'text': """<?xml version="1.0" encoding="UTF-8"?>
'text': f"""<?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Link rel="lrdd" type="application/xrd+xml"
template="https://{env['SERVER_NAME']}/.well-known/webfinger?resource={{uri}}"/>
@ -313,7 +306,9 @@ def despatch(env):
result = format_message_for_http(**result)
return result
return ERROR_404
return format_message_for_http(
status = 404,
)
class KepiHandler(FcgiHandler):

Wyświetl plik

@ -38,7 +38,6 @@ def test_fastcgi_simple():
},
)
assert found['Status'].startswith('404 ')
assert found['Content-Type']==HTML_MIMETYPE
def test_fastcgi_host_meta():