Initial AP objects implementation

This commit is contained in:
2024-02-21 11:07:26 -03:00
parent a0b15f6526
commit f9dedca988
5 changed files with 167 additions and 1 deletions

View File

@@ -22,7 +22,7 @@ PRequest buildRequest(string uri, string[string] params) {
PRequest rq = PRequest();
rq.method = "GET";
rq.url = format("http://%s/.well-known/webfinger", uri);
rq.url = format("https://%s/.well-known/webfinger", uri);
rq.headers["Accept"] = AcceptedWebfingerContentType;
QueryParam[] p;
@@ -49,3 +49,12 @@ JSONValue requestAcct(string uri, string acct) {
return parseJSON(rs.responseBody().toString());
}
JSONValue requestAcct(string handle) {
string uri, acct;
uri = handle.split("@")[$ - 1];
acct = handle.split("@")[$ - 2];
return requestAcct(uri, acct);
}