I am currently evaluating tyk-gateway for a project.
The idea is simple: The frontend (browser) connects to a backend (rest) via tyk-gateway, and tyk-gateway should be the mediator. I set up a virtual endpoint with JS and basically can connect to the backend and send back the response body to the frontend, but now I realized that there seems to be a difference between the Headers structures of request objects and response objects in the JS API.
If I am not mistaken, the Headers seem to be of the following structure:
in request from frontend (response function parameter): map[string]string
in request to backend (TykMakeHttpRequest): map[string]string
in response from backend (TykMakeHttpRequest): map[string]string
in response to frontend (TykJsResponse): map[string]string
Thus, questions arise: How can I simply transfer all headers from backend response to my response to frontend? How should I specify multiple headers like Set-Cookie in my response to frontend? I was not able to find documentation about this, and the example also does not discuss this.
Many thanks in advance!