light-my-request icon indicating copy to clipboard operation
light-my-request copied to clipboard

Follow redirect

Open Eomm opened this issue 3 years ago • 1 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

When a response has 301/302 status code, the inject should follow the redirects

Motivation

Ref https://github.com/fastify/help/issues/664

Example

const response = await app.inject({
      url: '/asd',
      method: 'GET',
      followRedirect: true // default max 1 redirect
      // OR
      followRedirect: 10 // follow max 10 redirect
    });

Eomm avatar Jul 22 '22 16:07 Eomm

I think this could be a plugin.

mcollina avatar Jul 22 '22 16:07 mcollina