bbyars / mountebank

Over the wire test doubles
http://www.mbtest.org
MIT License
2k stars 262 forks source link

Redirect instead of proxy? #771

Closed noel-yap closed 2 months ago

noel-yap commented 2 months ago

Is there a way to have mountebank perform a redirect instead of proxy?

Currently, we have mountebank configured to proxy to a third-party service which will return a JWT. This JWT is specific to mountebank's IP address and the service using it caches it. This works fine at this point.

The issue arises when mountebank's IP address changes. The JWT becomes invalid for use by the new IP address.

If redirection were possible, the JWT would be crafted for the calling service's IP address avoiding the issues above.

noel-yap commented 2 months ago

Looks like the following does what I need:

              "is": {
                "statusCode": 307,
                "headers": {
                  "location": "https://www.example.com/path"
                },
              },