forked from indymedia/epicyon
webfinger host-meta
parent
707cbd7d56
commit
9aa6527913
|
@ -186,7 +186,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
if self.server.debug:
|
||||
print('DEBUG: WEBFINGER host-meta')
|
||||
if self.path.startswith('/.well-known/host-meta'):
|
||||
wfResult=webfingerMeta()
|
||||
wfResult=webfingerMeta(self.server.httpPrefix,self.server.domainFull)
|
||||
if wfResult:
|
||||
msg=wfResult.encode('utf-8')
|
||||
self._set_headers('application/xrd+xml',len(msg),None)
|
||||
|
|
18
webfinger.py
18
webfinger.py
|
@ -140,17 +140,25 @@ def createWebfingerEndpoint(nickname: str,domain: str,port: int, \
|
|||
}
|
||||
return account
|
||||
|
||||
def webfingerMeta() -> str:
|
||||
def webfingerMeta(httpPrefix: str,domainFull: str) -> str:
|
||||
"""Return /.well-known/host-meta
|
||||
"""
|
||||
"""
|
||||
return "<?xml version=’1.0' encoding=’UTF-8'?>" \
|
||||
return \
|
||||
"<?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=\""+httpPrefix+"://"+domainFull+"/.well-known/webfinger?resource={uri}\"/>" \
|
||||
"</XRD>"
|
||||
|
||||
|
||||
|
||||
"<?xml version=’1.0' encoding=’UTF-8'?>" \
|
||||
"<XRD xmlns=’http://docs.oasis-open.org/ns/xri/xrd-1.0'" \
|
||||
" xmlns:hm=’http://host-meta.net/xrd/1.0'>" \
|
||||
"" \
|
||||
"<hm:Host>example.com</hm:Host>" \
|
||||
"<hm:Host>"+domainFull+"</hm:Host>" \
|
||||
"" \
|
||||
"<Link rel=’lrdd’" \
|
||||
" template=’http://example.com/describe?uri={uri}'>" \
|
||||
" template=’"+httpPrefix+"://"+domainFull+"/describe?uri={uri}'>" \
|
||||
" <Title>Resource Descriptor</Title>" \
|
||||
" </Link>" \
|
||||
"</XRD>"
|
||||
|
|
Loading…
Reference in New Issue