diff --git a/server/routes/index.ts b/server/routes/index.ts index db5685c3b..fb7a421e5 100644 --- a/server/routes/index.ts +++ b/server/routes/index.ts @@ -151,7 +151,7 @@ router.get("/robots.txt", (ctx) => { router.get("/opensearch.xml", (ctx) => { ctx.type = "text/xml"; - ctx.body = opensearchResponse(); + ctx.body = opensearchResponse(ctx.request.URL.origin); }); router.get("/share/:shareId", renderShare); diff --git a/server/utils/opensearch.ts b/server/utils/opensearch.ts index 8fc3e511f..044cdd25b 100644 --- a/server/utils/opensearch.ts +++ b/server/utils/opensearch.ts @@ -1,12 +1,12 @@ -export const opensearchResponse = (): string => { +export const opensearchResponse = (baseUrl: string): string => { return ` Outline Search Outline UTF-8 - ${process.env.URL}/favicon.ico - - ${process.env.URL}/search + ${baseUrl}/favicon.ico + + ${baseUrl}/search `; };