diff --git a/src/serviceproviders/matrix.js b/src/serviceproviders/matrix.js index 23f29d1..aa21037 100644 --- a/src/serviceproviders/matrix.js +++ b/src/serviceproviders/matrix.js @@ -28,7 +28,11 @@ const processURI = (uri, opts) => { if (match[2]) { const params = queryString.parse(match[2]) if ('org.keyoxide.e' in params && 'org.keyoxide.r' in params) { - proofUrl = utils.generateProxyURL('matrix', [params['org.keyoxide.r'], params['org.keyoxide.e']], opts) + proofUrl = utils.generateProxyURL( + 'matrix', + [params['org.keyoxide.r'], params['org.keyoxide.e']], + opts + ) } } @@ -64,7 +68,8 @@ const tests = [ shouldMatch: true, }, { - uri: 'matrix:u/@alice:matrix.domain.org?org.keyoxide.r=!123:domain.org&org.keyoxide.e=$123', + uri: + 'matrix:u/@alice:matrix.domain.org?org.keyoxide.r=!123:domain.org&org.keyoxide.e=$123', shouldMatch: true, }, { diff --git a/src/serviceproviders/twitter.js b/src/serviceproviders/twitter.js index c4e38e8..8adc7fa 100644 --- a/src/serviceproviders/twitter.js +++ b/src/serviceproviders/twitter.js @@ -25,10 +25,14 @@ const customRequestHandler = async (spData, opts) => { // Attempt direct verification if policy allows it if (opts.proxyPolicy !== 'always') { if ('twitterBearerToken' in opts && opts.twitterBearerToken) { - const res = await req(`https://api.twitter.com/1.1/statuses/show.json?id=${match[2]}`, null, { - Accept: 'application/json', - Authorization: `Bearer ${opts.twitterBearerToken}` - }) + const res = await req( + `https://api.twitter.com/1.1/statuses/show.json?id=${match[2]}`, + null, + { + Accept: 'application/json', + Authorization: `Bearer ${opts.twitterBearerToken}`, + } + ) const json = await res.json() return json.text } else if ('nitterInstance' in opts && opts.nitterInstance) { @@ -43,15 +47,15 @@ const customRequestHandler = async (spData, opts) => { return req(utils.generateProxyURL('twitter', match[2], opts), null, { Accept: 'application/json', }) - .then(async (res) => { - return await res.json() - }) - .then((res) => { - return res.data.text - }) - .catch((e) => { - reject(e) - }) + .then(async (res) => { + return await res.json() + }) + .then((res) => { + return res.data.text + }) + .catch((e) => { + reject(e) + }) } // No verification diff --git a/src/utils.js b/src/utils.js index b5b3d28..9283227 100644 --- a/src/utils.js +++ b/src/utils.js @@ -26,7 +26,9 @@ const generateProxyURL = (type, urlElements, opts) => { urlElements = [urlElements] } - urlElements = urlElements.map((x) => { return encodeURIComponent(x) }) + urlElements = urlElements.map((x) => { + return encodeURIComponent(x) + }) return `https://${ opts.doipProxyHostname