Comments (4)
Actually, I just tried something which had an effect ... in the startup for Kong, we include this setting:
-e "KONG_HEADERS=X-Kong-Proxy-Latency, X-Kong-Response-Latency, X-Kong-Upstream-Latency, X-Kong-Upstream-Status, X-Kong-Admin-Latency" \
This is because for security reasons, we want to ensure Kong does not include the "Via" header to clients (so they don't know they are talking to Kong). My understanding about this setting is that it tells Kong which are the "legal" headers to send to a client. When I removed this from the startup, now I'm seeing the X-Kong-Upstream-Status header that my plugin is adding. But I don't understand why the other "legal" headers like X-Kong-Upstream-Latency went through OK, and what is the connection between this setting and a bespoke plugin that tried to set one of the headers.
from kong-js-pdk.
@sec23206 In which phase is your plugins setting the header?
from kong-js-pdk.
@sec23206 In which phase is your plugins setting the header?
In the response phase.
from kong-js-pdk.
I feel like reponse phase is the reason but haven't verified. Although as it's name suggested, response
phase
is not actually what Kong is producing responses. It's more for plugins that requires to do some mutation or inspecting
of the response body. But access
may just be too early for your use case. In Lua Kong you can use header_filer but they
are not part of JS PDK.
Could you print the result of await kong.service.response.getStatus()
in the same phase?
from kong-js-pdk.
Related Issues (20)
- How to convert the response obtained from getRawBody() to a readable format ? HOT 2
- package.json no longer includes files for plugin_test.js HOT 1
- Incorrect assignment of mocked log functions in plugin_test.js
- Server tries to load all files in the folder as a plugin and fails to start HOT 3
- Problem reading gzipped kong.service.response.get_raw_body() HOT 11
- Modifying response body (no body_filter phase?) HOT 3
- Question: How to wrote Unit tests using plugin_test.js HOT 1
- How to cache stuff? HOT 1
- Issues running tests HOT 4
- Question: How to see plugin error inside docker container logs HOT 2
- Missing plugin socket HOT 2
- Critical severity alert on msgpack dependency HOT 2
- Accessing Binary Files in plugin HOT 3
- Share Data between Plugins in Kong JS PDK HOT 2
- How to set no_consumer flag with kong-js-pdk Schema HOT 4
- Reference to a incorrect module functions HOT 3
- Kong unable to load js plugin HOT 10
- Simplify Module Loading HOT 7
- Plugin Test Case - Cannot use import statement outside a module error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kong-js-pdk.