I have a case, where a lambda function is modifying my response Location header by adding current query parameters during redirect. How can we avoid that?
Function accepts callback from OAuth provider, and it is invoked like this: /.netlify/functions/oauth-callback?token=1&secret=2
At the end of function, user should be redirected to /
(I tried both absolute and relative paths)
return {
headers: { Location: "/" },
statusCode: 301,
};
But this Location header is added to the response:
Location: /?token=1&secret=2
As I understand, that should not happen.