fix: better HEAD handling with less special casing (#1206)
We now add a default HEAD handler to the server, rather than special casing HEAD requests elsewhere. Static files now get their own optimized HEAD handler that does not read the file contents.
This commit is contained in:
+2
-2
@@ -67,7 +67,7 @@ Deno.test("/[name] page prerender", async () => {
|
||||
assertStringIncludes(body, "<div>Hello bar</div>");
|
||||
});
|
||||
|
||||
Deno.test("/intercept - HEAD", async () => {
|
||||
Deno.test("/api/head_override - HEAD", async () => {
|
||||
const req = new Request("https://fresh.deno.dev/api/head_override", {
|
||||
method: "HEAD",
|
||||
});
|
||||
@@ -81,7 +81,7 @@ Deno.test("/intercept - HEAD", async () => {
|
||||
);
|
||||
});
|
||||
|
||||
Deno.test("/intercept - HEAD fallback", async () => {
|
||||
Deno.test("/api/get_only - HEAD fallback", async () => {
|
||||
const req = new Request("https://fresh.deno.dev/api/get_only", {
|
||||
method: "HEAD",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user