From 1343a6469f91728d5f9718895b4eaeab1ca07190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elian=20=E2=98=95=EF=B8=8F?= Date: Thu, 9 Mar 2023 16:28:21 +0100 Subject: [PATCH 1/3] =?UTF-8?q?Get=20rid=20of=20=E2=80=98txt=20not=20found?= =?UTF-8?q?=E2=80=99=20(#6486)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/integrations/sitemap/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integrations/sitemap/README.md b/packages/integrations/sitemap/README.md index f4949ca51614..99e730997403 100644 --- a/packages/integrations/sitemap/README.md +++ b/packages/integrations/sitemap/README.md @@ -91,7 +91,7 @@ After verifying that the sitemaps are built, you can add them to your site's ` ``` -```txt ins={4} title="public/robots.txt" +```yaml ins={4} title="public/robots.txt" User-agent: * Allow: / From 700a55549925e2a0ef2da378a20a2a5d35c53b93 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Thu, 9 Mar 2023 11:27:16 -0500 Subject: [PATCH 2/3] Add back support for Astro.clientAddress to Vercel serverless (#6484) --- .changeset/lemon-steaks-care.md | 5 +++++ .../vercel/src/serverless/request-transform.ts | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .changeset/lemon-steaks-care.md diff --git a/.changeset/lemon-steaks-care.md b/.changeset/lemon-steaks-care.md new file mode 100644 index 000000000000..848db8fcd845 --- /dev/null +++ b/.changeset/lemon-steaks-care.md @@ -0,0 +1,5 @@ +--- +'@astrojs/vercel': patch +--- + +Add back support for Astro.clientAddress diff --git a/packages/integrations/vercel/src/serverless/request-transform.ts b/packages/integrations/vercel/src/serverless/request-transform.ts index 6a86ad976571..819b8e8fecf6 100644 --- a/packages/integrations/vercel/src/serverless/request-transform.ts +++ b/packages/integrations/vercel/src/serverless/request-transform.ts @@ -2,6 +2,8 @@ import type { App } from 'astro/app'; import type { IncomingMessage, ServerResponse } from 'node:http'; import { splitCookiesString } from 'set-cookie-parser'; +const clientAddressSymbol = Symbol.for('astro.clientAddress'); + /* Credits to the SvelteKit team https://github.com/sveltejs/kit/blob/8d1ba04825a540324bc003e85f36559a594aadc2/packages/kit/src/exports/node/index.js @@ -99,13 +101,16 @@ export async function getRequest( req: IncomingMessage, bodySizeLimit?: number ): Promise { - return new Request(base + req.url, { + let headers = req.headers as Record; + let request = new Request(base + req.url, { // @ts-expect-error duplex: 'half', method: req.method, - headers: req.headers as Record, + headers, body: get_raw_body(req, bodySizeLimit), }); + Reflect.set(request, clientAddressSymbol, headers['x-forwarded-for']); + return request; } export async function setResponse( From 7d1dd510fbc450b471074f165ea28ca2160e26dc Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Thu, 9 Mar 2023 11:23:47 -0600 Subject: [PATCH 3/3] chore: update example favicons (#6487) --- examples/basics/public/favicon.svg | 20 +++++++----------- examples/blog/public/favicon.svg | 20 +++++++----------- examples/deno/public/favicon.ico | Bin 4286 -> 0 bytes examples/deno/public/favicon.svg | 9 ++++++++ examples/deno/src/components/Layout.astro | 2 +- examples/docs/public/favicon.svg | 20 +++++++----------- examples/framework-alpine/public/favicon.svg | 20 +++++++----------- examples/framework-lit/public/favicon.svg | 20 +++++++----------- .../framework-multiple/public/favicon.svg | 20 +++++++----------- examples/framework-preact/public/favicon.svg | 20 +++++++----------- examples/framework-react/public/favicon.svg | 20 +++++++----------- examples/framework-solid/public/favicon.svg | 20 +++++++----------- examples/framework-svelte/public/favicon.svg | 20 +++++++----------- examples/framework-vue/public/favicon.svg | 20 +++++++----------- examples/hackernews/public/favicon.svg | 20 +++++++----------- examples/minimal/public/favicon.svg | 20 +++++++----------- examples/non-html-pages/public/favicon.svg | 20 +++++++----------- examples/portfolio/public/favicon.svg | 20 +++++++----------- examples/ssr/public/favicon.svg | 20 +++++++----------- examples/with-markdoc/public/favicon.svg | 20 +++++++----------- .../with-markdown-plugins/public/favicon.svg | 20 +++++++----------- .../with-markdown-shiki/public/favicon.svg | 20 +++++++----------- examples/with-mdx/public/favicon.svg | 20 +++++++----------- examples/with-nanostores/public/favicon.svg | 20 +++++++----------- examples/with-tailwindcss/public/favicon.svg | 20 +++++++----------- .../with-vite-plugin-pwa/public/favicon.svg | 20 +++++++----------- examples/with-vitest/public/favicon.svg | 20 +++++++----------- 27 files changed, 202 insertions(+), 289 deletions(-) delete mode 100644 examples/deno/public/favicon.ico create mode 100644 examples/deno/public/favicon.svg diff --git a/examples/basics/public/favicon.svg b/examples/basics/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/basics/public/favicon.svg +++ b/examples/basics/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/blog/public/favicon.svg b/examples/blog/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/blog/public/favicon.svg +++ b/examples/blog/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/deno/public/favicon.ico b/examples/deno/public/favicon.ico deleted file mode 100644 index 578ad458b8906c08fbed84f42b045fea04db89d1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4286 zcmchZF=!M)6ox0}Fc8GdTHG!cdIY>nA!3n2f|wxIl0rn}Hl#=uf>?-!2r&jMEF^_k zh**lGut*gwBmoNv7AaB&2~nbzULg{WBhPQ{ZVzvF_HL8Cb&hv$_s#qN|IO^o>?+mA zuTW6tU%k~z<&{z+7$G%*nRsTcEO|90xy<-G5&JTt%CgZZCDT4%R?+{Vd^wh>P8_)} z`+dF$HQb9!>1o`Ivn;GInlCw{9T@Rt%q+d^T3Ke%cxkk;$v`{s^zCB9nHAv6w$Vbn z8fb<+eQTNM`;rf9#obfGnV#3+OQEUv4gU;{oA@zol%keY9-e>4W>p7AHmH~&!P7f7!Uj` zwgFeQ=<3G4O;mwWO`L!=R-=y3_~-DPjH3W^3f&jjCfC$o#|oGaahSL`_=f?$&Aa+W z2h8oZ+@?NUcjGW|aWJfbM*ZzxzmCPY`b~RobNrrj=rd`=)8-j`iSW64@0_b6?;GYk zNB+-fzOxlqZ?`y{OA$WigtZXa8)#p#=DPYxH=VeC_Q5q9Cv`mvW6*zU&Gnp1;oPM6 zaK_B3j(l^FyJgYeE9RrmDyhE7W2}}nW%ic#0v@i1E!yTey$W)U>fyd+!@2hWQ!Wa==NAtKoj`f3tp4y$Al`e;?)76?AjdaRR>|?&r)~3Git> zb1)a?uiv|R0_{m#A9c;7)eZ1y6l@yQ#oE*>(Z2fG-&&smPa2QTW>m*^K65^~`coP$ z8y5Y?iS<4Gz{Zg##$1mk)u-0;X|!xu^FCr;ce~X<&UWE&pBgqfYmEJTzpK9I%vr%b z3Ksd6qlPJLI%HFfeXK_^|BXiKZC>Ocu(Kk6hD3G-8usLzVG^q00Qh gz)s7ge@$ApxGu7=(6IGIk+uG&HTev01^#CH3$(Wk5&!@I diff --git a/examples/deno/public/favicon.svg b/examples/deno/public/favicon.svg new file mode 100644 index 000000000000..f157bd1c5e28 --- /dev/null +++ b/examples/deno/public/favicon.svg @@ -0,0 +1,9 @@ + + + + diff --git a/examples/deno/src/components/Layout.astro b/examples/deno/src/components/Layout.astro index fc09951543a9..60a7e6d87126 100644 --- a/examples/deno/src/components/Layout.astro +++ b/examples/deno/src/components/Layout.astro @@ -11,7 +11,7 @@ const { title } = Astro.props as Props; - + {title} diff --git a/examples/docs/public/favicon.svg b/examples/docs/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/docs/public/favicon.svg +++ b/examples/docs/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/framework-alpine/public/favicon.svg b/examples/framework-alpine/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/framework-alpine/public/favicon.svg +++ b/examples/framework-alpine/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/framework-lit/public/favicon.svg b/examples/framework-lit/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/framework-lit/public/favicon.svg +++ b/examples/framework-lit/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/framework-multiple/public/favicon.svg b/examples/framework-multiple/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/framework-multiple/public/favicon.svg +++ b/examples/framework-multiple/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/framework-preact/public/favicon.svg b/examples/framework-preact/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/framework-preact/public/favicon.svg +++ b/examples/framework-preact/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/framework-react/public/favicon.svg b/examples/framework-react/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/framework-react/public/favicon.svg +++ b/examples/framework-react/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/framework-solid/public/favicon.svg b/examples/framework-solid/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/framework-solid/public/favicon.svg +++ b/examples/framework-solid/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/framework-svelte/public/favicon.svg b/examples/framework-svelte/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/framework-svelte/public/favicon.svg +++ b/examples/framework-svelte/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/framework-vue/public/favicon.svg b/examples/framework-vue/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/framework-vue/public/favicon.svg +++ b/examples/framework-vue/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/hackernews/public/favicon.svg b/examples/hackernews/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/hackernews/public/favicon.svg +++ b/examples/hackernews/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/minimal/public/favicon.svg b/examples/minimal/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/minimal/public/favicon.svg +++ b/examples/minimal/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/non-html-pages/public/favicon.svg b/examples/non-html-pages/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/non-html-pages/public/favicon.svg +++ b/examples/non-html-pages/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/portfolio/public/favicon.svg b/examples/portfolio/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/portfolio/public/favicon.svg +++ b/examples/portfolio/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/ssr/public/favicon.svg b/examples/ssr/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/ssr/public/favicon.svg +++ b/examples/ssr/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/with-markdoc/public/favicon.svg b/examples/with-markdoc/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/with-markdoc/public/favicon.svg +++ b/examples/with-markdoc/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/with-markdown-plugins/public/favicon.svg b/examples/with-markdown-plugins/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/with-markdown-plugins/public/favicon.svg +++ b/examples/with-markdown-plugins/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/with-markdown-shiki/public/favicon.svg b/examples/with-markdown-shiki/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/with-markdown-shiki/public/favicon.svg +++ b/examples/with-markdown-shiki/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/with-mdx/public/favicon.svg b/examples/with-mdx/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/with-mdx/public/favicon.svg +++ b/examples/with-mdx/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/with-nanostores/public/favicon.svg b/examples/with-nanostores/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/with-nanostores/public/favicon.svg +++ b/examples/with-nanostores/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/with-tailwindcss/public/favicon.svg b/examples/with-tailwindcss/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/with-tailwindcss/public/favicon.svg +++ b/examples/with-tailwindcss/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/with-vite-plugin-pwa/public/favicon.svg b/examples/with-vite-plugin-pwa/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/with-vite-plugin-pwa/public/favicon.svg +++ b/examples/with-vite-plugin-pwa/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + + diff --git a/examples/with-vitest/public/favicon.svg b/examples/with-vitest/public/favicon.svg index 0f3906297879..f157bd1c5e28 100644 --- a/examples/with-vitest/public/favicon.svg +++ b/examples/with-vitest/public/favicon.svg @@ -1,13 +1,9 @@ - - - - - - - - - - + + +