Remove pixelfed from detector response

This commit is contained in:
AkiraFukushima 2020-03-13 22:28:53 +09:00
parent 67fa69ba20
commit d7c9442533
2 changed files with 1 additions and 14 deletions

View file

@ -1213,10 +1213,7 @@ type Instance = {
* @param proxyConfig Proxy setting, or set false if don't use proxy.
* @return SNS name.
*/
export const detector = async (
url: string,
proxyConfig: ProxyConfig | false = false
): Promise<'mastodon' | 'pleroma' | 'pixelfed' | 'misskey'> => {
export const detector = async (url: string, proxyConfig: ProxyConfig | false = false): Promise<'mastodon' | 'pleroma' | 'misskey'> => {
let options: AxiosRequestConfig = {}
if (proxyConfig) {
options = Object.assign(options, {
@ -1227,8 +1224,6 @@ export const detector = async (
const res = await axios.get<Instance>(url + '/api/v1/instance', options)
if (res.data.version.includes('Pleroma')) {
return 'pleroma'
} else if (res.data.version.includes('Pixelfed')) {
return 'pixelfed'
} else {
return 'mastodon'
}

View file

@ -24,12 +24,4 @@ describe('detector', () => {
expect(misskey).toEqual('misskey')
})
})
describe('pixelfed', () => {
const url = 'https://pixelfed.tokyo'
it('should be pixelfed', async () => {
const pixelfed = await detector(url)
expect(pixelfed).toEqual('pixelfed')
})
})
})