Skip to content

Reply was already sent, did you forget to "return reply" in / #419

@leonied7

Description

@leonied7

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

5.3.0

Plugin version

12.1.0

Node.js version

22.12.0

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

all

Description

Given the simple target and proxy service:

const target = fastify();

target.get('/', (request, reply) => {
  setTimeout(() => {
    reply.send('hello');
  }, 5000);
});

target.listen({ port: 0 });

const proxy = fastify({
  logger: true
});
proxy.register(fastifyReplyFrom);

proxy.addHook('onRequest', (request, reply) => {
  return reply.from(`http://localhost:${target.server.address().port}/`);
});

proxy.listen({ port: 53347 })

Send request to GET http://localhost:53347/ and abort it before the target answering

The proxy try to send answer after answering from the target

Link to code that reproduces the bug

Expected Behavior

A warning not happend

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions