supabase / functions-relay

API Gateway for Supabase Edge functions
MIT License
35 stars 9 forks source link

502 Bad Gateway from time to time on Edge Function POST request #25

Open dmythro opened 1 year ago

dmythro commented 1 year ago

Bug report

Describe the bug

Getting 502 from time to time on a simple POST request.

To Reproduce

Function code, exactly as I have it now (just started testing functions with Authorization header):

import { serve } from "https://deno.land/std@0.168.0/http/server.ts"

console.log("Hello from Functions!")

serve((req: Request) => {
  const data = {
    message: `Hello ${req.headers.get("Authorization") || ""}!`,
  }

  return new Response(JSON.stringify(data), {
    headers: { "Content-Type": "application/json" },
  })
})

Expected behavior

Expect longer execution on a cold start, but not 502 on repeated request, even not on a cold start. Looks pretty unstable to me to use on projects.

Screenshots

image

System information