We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c8d525 commit 4cd13a4Copy full SHA for 4cd13a4
index.js
@@ -48,13 +48,15 @@ app.use(async ctx => {
48
}
49
};
50
} else {
51
- const resp = await fetch(
52
- `${apiBaseUrl}${ctx.request.requestTarget}?embed=true`, {
53
- headers: {
54
- Accept: 'application/json'
55
- }
+ const newUrl = new URL(`${apiBaseUrl}${ctx.request.requestTarget}`);
+ if(!newUrl.searchParams.has('embed')) {
+ newUrl.searchParams.append('embed', 'true');
+ }
+ const resp = await fetch(newUrl, {
56
+ headers: {
57
+ Accept: 'application/json'
58
- );
59
+ });
60
const rv = await resp.json();
61
const localhosted = JSON.stringify(rv).replaceAll(apiBaseUrl, '');
62
ctx.response.body = localhosted;
0 commit comments