mirror of
https://github.com/CompeyDev/fxtwitter-docker.git
synced 2025-04-10 21:10:54 +01:00
Fixed hardcoded URL in oembed
This commit is contained in:
parent
0f551437af
commit
f36a03eade
1 changed files with 7 additions and 6 deletions
|
@ -1,6 +1,5 @@
|
||||||
import { Router } from 'itty-router';
|
import { Router } from 'itty-router';
|
||||||
import { Constants } from './constants';
|
import { Constants } from './constants';
|
||||||
import { fetchUsingGuest } from './drivers/guest';
|
|
||||||
import { handleStatus } from './status';
|
import { handleStatus } from './status';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -53,13 +52,15 @@ router.get('/owoembed', async (request: any) => {
|
||||||
const { searchParams } = new URL(request.url)
|
const { searchParams } = new URL(request.url)
|
||||||
|
|
||||||
let text = searchParams.get('text') || 'Twitter';
|
let text = searchParams.get('text') || 'Twitter';
|
||||||
|
let author = searchParams.get('author') || 'dangeredwolf';
|
||||||
|
let status = searchParams.get('status') || '1547514042146865153';
|
||||||
|
|
||||||
const test = {
|
const test = {
|
||||||
"author_name":text,
|
"author_name":decodeURIComponent(text),
|
||||||
"author_url":"https://twitter.com/AquosTheWolf/status/1547447632284553216",
|
"author_url":`https://twitter.com/${encodeURIComponent(author)}/status/${encodeURIComponent(status)}`,
|
||||||
"provider_name":"pxTwitter",
|
"provider_name":"pxTwitter",
|
||||||
"provider_url":"https://github.com/dangeredwolf/pxtwitter",
|
"provider_url":"https://github.com/dangeredwolf/pxtwitter",
|
||||||
"title":"test",
|
"title":"Twitter",
|
||||||
"type":"link",
|
"type":"link",
|
||||||
"version":"1.0"
|
"version":"1.0"
|
||||||
}
|
}
|
||||||
|
@ -72,7 +73,7 @@ router.get('/owoembed', async (request: any) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
router.all('*', async request => {
|
router.all('*', async request => {
|
||||||
return Response.redirect(Constants.REDIRECT_URL);
|
return Response.redirect(Constants.REDIRECT_URL, 307);
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue