Skip to content

net.http_post doesn't send bodies over 65536 bytes (64 KB) #225

@alxndrsn

Description

@alxndrsn

Bug report

When calling net.http_post() with a body over 65536 bytes, the first 65536 bytes are sent, and the request then hangs.

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

When calling net.http_post() with a body over 65536 bytes, the first 65536 bytes are sent, and the request then hangs.

To Reproduce

  1. run an HTTP server locally on port 1337 to accept POST requests at /
  2. run this script:
docker exec -it --env PAGER='' supabase_db_server-v2 psql -U postgres \
-c "SELECT net.http_post('http://$(hostname -I | cut -d' ' -f1):1337', ('{\"val\":\"' || (SELECT string_agg(lpad(to_hex(n%256),2,'0') ,'') FROM generate_series(1, 65520/2) AS n)||'\"}')::JSONB);"
  1. observe that it works ok

  2. run this script (note the different series length):

docker exec -it --env PAGER='' supabase_db_server-v2 psql -U postgres \
-c "SELECT net.http_post('http://$(hostname -I | cut -d' ' -f1):1337', ('{\"val\":\"' || (SELECT string_agg(lpad(to_hex(n%256),2,'0') ,'') FROM generate_series(1, 65540/2) AS n)||'\"}')::JSONB);"

Note that the HTTP server will not receive the full request.

Expected behavior

Full request body should be sent.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: [e.g. macOS, Windows]
  • Browser (if applies) N/A
  • Version of supabase-js: 2.34.3
  • Version of Node.js: N/A

Additional context

Running locally with npx supabase start

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions