feat: implement checking of /.well-known/gorb.txt for api url, remove old localStorage lines
This commit is contained in:
parent
f39ff00b3b
commit
bc8e84b75d
2 changed files with 29 additions and 13 deletions
11
utils/parseWellKnown.ts
Normal file
11
utils/parseWellKnown.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
export default (wellKnownText: string): Record<string, string> => {
|
||||
const lines = wellKnownText.trim().replaceAll(" ", "").split("\n");
|
||||
const settings: Record<string, string> = {};
|
||||
for (const line of lines) {
|
||||
const separatorIndex = line.search(":");
|
||||
const key = line.slice(0, separatorIndex);
|
||||
const value = line.slice(separatorIndex + 1, line.length);
|
||||
settings[key] = value;
|
||||
}
|
||||
return settings;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue