From f74ccc9753425b8f6554a47db1f8614b0518e3b6 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Tue, 26 Jul 2022 14:56:38 -0500 Subject: [PATCH] Remove HEAD request method limitation from On-Demand ISR example (#369) --- .../.vercel/output/functions/revalidate.func/index.js | 2 +- build-output-api/on-demand-isr/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-output-api/on-demand-isr/.vercel/output/functions/revalidate.func/index.js b/build-output-api/on-demand-isr/.vercel/output/functions/revalidate.func/index.js index 8e61e7c3f..23330111d 100644 --- a/build-output-api/on-demand-isr/.vercel/output/functions/revalidate.func/index.js +++ b/build-output-api/on-demand-isr/.vercel/output/functions/revalidate.func/index.js @@ -15,7 +15,7 @@ function revalidate(host, path) { hostname: host, port: 443, path, - method: 'GET', // MUST be "GET" ("HEAD" and "POST" methods will not work) + method: 'GET', // MUST be "GET" or "HEAD" ("POST" method will not work) headers: { 'x-prerender-revalidate': bypassToken } diff --git a/build-output-api/on-demand-isr/README.md b/build-output-api/on-demand-isr/README.md index 3cf62f7df..be9a732d7 100644 --- a/build-output-api/on-demand-isr/README.md +++ b/build-output-api/on-demand-isr/README.md @@ -18,7 +18,7 @@ Click on one of the "Revalidate" links to see the associated value update. After When using Prerender Functions, you may want to revalidate the cache for a specific path based on an event (On-Demand). -To revalidate a path to a Prerender Function, make a `GET` request to that path with a header of `x-prerender-revalidate: `. The `` must match the value in that Prerender Function's `.prerender-config.json` file. +To revalidate a path to a Prerender Function, make a `GET` or `HEAD` request to that path with a header of `x-prerender-revalidate: `. The `` must match the value in that Prerender Function's `.prerender-config.json` file. In this demo, you can see this happening with two paths: `/` and `/data`.