Use caps for http method types

This commit is contained in:
Michael Wolf
2025-03-07 20:25:13 -06:00
parent 8d494cdf3b
commit d1d4e03885

View File

@@ -8,17 +8,17 @@ import { HttpCode, httpCodes } from "./http-codes.ts";
import { ContentType, contentTypes } from "./content-types.ts";
const methodParser = z.union([
z.literal("get"),
z.literal("post"),
z.literal("put"),
z.literal("patch"),
z.literal("delete"),
z.literal("GET"),
z.literal("POST"),
z.literal("PUT"),
z.literal("PATCH"),
z.literal("DELETE"),
]);
export type Method = z.infer<typeof methodParser>;
const massageMethod = (input: string): Method => {
const r = methodParser.parse(input.toLowerCase())
const r = methodParser.parse(input.toUpperCase())
return r;
};