Skip to content

Commit 2369221

Browse files
committed
Revert to using request origin for widget fetching
1 parent f4efe59 commit 2369221

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

netlify/edge-functions/proxy-api-docs.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { DOMParser } from "https://deno.land/x/deno_dom@v0.1.56/deno-dom-wasm.ts
22

33
export default async (request, context) => {
44
const url = new URL(request.url);
5-
const productionOrigin = "https://docs.redpanda.com";
5+
const originalOrigin = url.origin;
66

77
// Redirects from old API paths to new ones
88
const redirects = {
@@ -77,9 +77,9 @@ export default async (request, context) => {
7777
footerWidget,
7878
] = await Promise.all([
7979
bumpRes.text(),
80-
fetchWidget(`${productionOrigin}/assets/widgets/head-bump.html`, "head-bump"),
81-
fetchWidget(`${productionOrigin}/assets/widgets/header.html`, "header"),
82-
fetchWidget(`${productionOrigin}/assets/widgets/footer.html`, "footer"),
80+
fetchWidget(`${originalOrigin}/assets/widgets/head-bump.html`, "head-bump"),
81+
fetchWidget(`${originalOrigin}/assets/widgets/header.html`, "header"),
82+
fetchWidget(`${originalOrigin}/assets/widgets/footer.html`, "footer"),
8383
]);
8484

8585
const document = new DOMParser().parseFromString(originalHtml, "text/html");

0 commit comments

Comments
 (0)