Closed
Description
🐛 Bug Report
Hey, thanks for this amazing project. I have some trouble when the upstream servers are triggering some redirects. It seems that the proxy is prefixing the
To Reproduce
Steps to reproduce the behavior:
const Fastify = require('fastify')
const proxy = require('fastify-http-proxy')
const server = Fastify()
const upstream = Fastify()
// Declare a route
const Fastify = require('fastify');
const proxy = require('fastify-http-proxy');
const server = Fastify();
const upstream = Fastify();
// Declare a route
upstream.get('/', async (request, reply) => {
return reply.redirect(302, 'https://google.com');
});
upstream.get('/foo', async (request, reply) => {
return reply.send({hello: 'world'});
});
upstream.listen(3001);
server.register(proxy, {
upstream: 'http://localhost:3001',
prefix: '/bar'
});
server.listen(3000);
Expected behavior
Visiting http://localhost:3000/bar/foo
the proxy works as expected, visiting http://localhost:3000/bar
a new redirect was triggered to /barhttps://google.com
Your Environment
- node version: 14
- fastify version: 3.9.2
- os: Mac
Metadata
Metadata
Assignees
Labels
No labels