Global request headers injection doesn’t work after looping
APIDEF1:
{
"name": "Tyk Keyless Looping API",
"api_id": "keyless-looping-test",
"org_id": "default",
"definition": {
"location": "header",
"key": "version"
},
"use_keyless": true,
"version_data": {
"not_versioned": true,
"versions": {
"Default": {
"name": "Default",
"global_headers": {
"X-looping1": "someValue"
}
}
}
},
"driver": "otto",
"disable_rate_limit": true,
"proxy": {
"listen_path": "/keyless-looping-test/",
"target_url": "tyk://keyless-test",
"strip_listen_path": true
}
}
APIDEF2:
{
"name": "Tyk Test Keyless API",
"api_id": "keyless-test",
"org_id": "default",
"definition": {
"location": "header",
"key": "version"
},
"use_keyless": true,
"version_data": {
"not_versioned": true,
"versions": {
"Default": {
"name": "Default",
"global_headers": {
"X-looping2": "ThisWillNotBeInjected"
}
}
}
},
"driver": "otto",
"disable_rate_limit": true,
"proxy": {
"listen_path": "/keyless-test/",
"target_url": "http://httpbin.org",
"strip_listen_path": true
}
}
- API1 is looping to API2.
- API1 can be called using
curl -s 'http://localhost:8080/keyless-looping-test/get'
(tyk running on port 8080) - In output we can see that header from API1 is injected but API2 failed to inject any header (is this a bug?)
{
"args": {},
"headers": {
"Accept": "*/*",
"Accept-Encoding": "gzip",
"Host": "httpbin.org",
"User-Agent": "curl/7.81.0",
"X-Amzn-Trace-Id": "Root=1-634fa839-5451453109031d7c04505e55",
"X-Looping1": "someValue"
},
"origin": "172.28.0.1, externalip",
"url": "http://httpbin.org/get"
}
Note that header injection from API2 works fine If I remove looping and replace tyk://keyless-test
in API1 to http://localhost:8080/keyless-test
Tyk version: v4.2.2
Actual issue: I am looping from keyless API1 to API2 (that is using custom authentication gRPC plugin.) I want to inject headers in API2 without writing another middleware. Note that custom Auth middleware used by API2 is already setting Metadata that I want to inject in upsteam request headers