transform POST methods to uppercase for fixing

This commit is contained in:
MeowcaTheoRange 2023-10-15 13:06:17 -05:00
parent b3547b6f0d
commit 67ce409ffa
3 changed files with 3 additions and 3 deletions

View file

@ -13,7 +13,7 @@ export default async function handler(
res: NextApiResponse
) {
const { body, method } = req;
if (method === "POST") {
if (method?.toUpperCase() === "POST") {
let validatedClan;
try {
validatedClan = await SubmitClanSchema.validate(body, {

View file

@ -11,7 +11,7 @@ export default async function handler(
res: NextApiResponse
) {
const { body, method, cookies, query } = req;
if (method === "POST") {
if (method?.toUpperCase() === "POST") {
let validatedMessage;
try {
validatedMessage = await SubmitMessageSchema.validate(body, {

View file

@ -11,7 +11,7 @@ export default async function handler(
res: NextApiResponse
) {
const { body, method, cookies } = req;
if (method === "POST") {
if (method?.toUpperCase() === "POST") {
let validatedTroll;
try {
validatedTroll = await SubmitTrollSchema.validate(body, {