reddit: don't include title in API request path

This commit is contained in:
dumbmoron 2023-11-23 14:45:52 +00:00
parent 190a0131d4
commit 7468b803fb
No known key found for this signature in database
GPG key ID: C59997C76C6A8E5F

View file

@ -48,7 +48,7 @@ async function getAccessToken() {
} }
export default async function(obj) { export default async function(obj) {
const url = new URL(`https://www.reddit.com/r/${obj.sub}/comments/${obj.id}/${obj.title}.json`); const url = new URL(`https://www.reddit.com/r/${obj.sub}/comments/${obj.id}.json`);
const accessToken = await getAccessToken(); const accessToken = await getAccessToken();
if (accessToken) url.hostname = 'oauth.reddit.com'; if (accessToken) url.hostname = 'oauth.reddit.com';