routing-controllers icon indicating copy to clipboard operation
routing-controllers copied to clipboard

Problems with redirect annotation

Open tuturis opened this issue 6 years ago • 0 comments

I have a controller method decorated with @Redirect("https://some.where/?:id") that returns an object that interpolates id of the mentioned string. The problem is when I try to run a test (Jest/Supertest )on this endpoint - it returns correct(?) status (302 (Found)) but the response object contains strings that are not interpolated with returned ID (response: {text:https://some.where/?:id , Header: {'location': https://some.where/?:id}, ...} is it possible to get the actual end URL of the redirect? Is it express thing or typedi?.

EDIT: Resolved by using res.redirect

tuturis avatar Jan 28 '20 15:01 tuturis