You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should return from a HEAD function if defined in the correct file, otherwise fall back on GET request (omitting the body of the response).
Steps to reproduce 🕹
Steps:
Create an api file src/routes/my/api/route.json.ts
Add export function HEAD = async () => new Response('', { status: 200 });
(OR) Add export function GET = async () => new Response('', { status: 200 });
curl --head https://example.com/my/api/route.json
Context 🔦
I'm generating OG images on my server and using a third-party service to cache and re-serve them from their CDN. This services makes HEAD requests to ensure the file exists before attempting to serve it. Since HEAD responses are giving 404s, the service will not try to serve the file.
Your environment 🌎
n/a
The text was updated successfully, but these errors were encountered:
Duplicates
Latest version
Current behavior 😯
curl --head https://example.com/my/api/route.json
Always returns a 404
Expected behavior 🤔
Should return from a HEAD function if defined in the correct file, otherwise fall back on GET request (omitting the body of the response).
Steps to reproduce 🕹
Steps:
src/routes/my/api/route.json.ts
export function HEAD = async () => new Response('', { status: 200 });
export function GET = async () => new Response('', { status: 200 });
curl --head https://example.com/my/api/route.json
Context 🔦
I'm generating OG images on my server and using a third-party service to cache and re-serve them from their CDN. This services makes HEAD requests to ensure the file exists before attempting to serve it. Since HEAD responses are giving 404s, the service will not try to serve the file.
Your environment 🌎
The text was updated successfully, but these errors were encountered: