Skip to content

bug(pipes): a write pipe answers GET, which proxies and clients replay #663

Description

@EricAndrechek

Area: pipes

With #634 (in review), a pipe whose SQL is a write runs on every call, and is neither cached nor coalesced (#386). It can still be called with GET /v1/pipes/{name}. Along the way, GET is treated as safe and idempotent, so a single call can turn into several writes:

  • A reverse proxy retries a failed GET on the next upstream (nginx's default proxy_next_upstream), but not a POST.
  • Go's http.Transport may resend a GET without a body when a reused connection dies.
  • Link unfurlers and prefetchers fetch GET URLs. ?token= puts the credential in the URL, so a pasted link carries its own authorization.

Each replay is another write: the mirror image of #386.

Proposal: when a write pipe is called with GET, answer 405 Method Not Allowed with Allow: POST. The handler already classifies the bound SQL. The TS SDK already calls pipes with POST (clients/ts/src/pipes.test.ts: "fetch() POSTs to /v1/pipes/{name}"), so it is unaffected. Document the rule in pipes.mdx ("Pipes that write") and in api.md.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/pipesNamed query pipesbugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions