Feature response headers - #3172
Conversation
|
Any changes I need to make? |
|
If it was me I'd see if you could define it to be a entry for shared policies or so, So you can apply it more universal across all resources.. but that's just me. Alongside the induvial entries. They're just a bit backlogged right now 🙂 |
|
LGTM. Should the checks distinguish between header types for more accurate error messages? This is not about your PR, but a general observation: I'm not sure the checks work as intended. I can "set" everything with Pangolin 1.19.4. Shouldn't this result in an error message and not fail silently on the backend, discarding the users changes? Maybe the client side validation should be improved nonetheless. @AstralDestiny I would keep the scope of this PR to the current implementation and your request to another, as it also applies to the already existing implementation of |
|
We are not ignoring this! I appreciate your contribution! We will review around the prep for the next release. |
|
@Root-Core what checks are failing? Would you be able to give an example so we can look into resolving that? |
|
@oschwartz10612 I linked you the corresponding server side code below, but it is not the cause of this issue. pangolin/server/routers/resource/updateResource.ts Lines 164 to 208 in 784588c I investigated it a bit and the I assume there is some client side validation - which skips the invalid setting, but it does not show any error / hint and sends the old settings. I think this is not correctly handled in HeadersInput.tsx, but I have not investigated further. |
@oschwartz10612 Great! should I resolve the merge conflicts before that? |
|
Sure feel free to give it a shot! :}
|
…ders # Conflicts: # server/db/pg/schema/schema.ts # server/lib/blueprints/proxyResources.ts # server/routers/resource/getResource.ts # src/app/[orgId]/settings/resources/proxy/[niceId]/proxy/page.tsx # src/components/HealthCheckCredenza.tsx
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
Closes #2789 and feature request: #1939
Pangolin previously only supported injecting custom headers into requests forwarded to downstream targets (
customRequestHeaders). This PR addsresponseHeadersand renames the existingheadersfield torequestHeadersthroughout the stack for clarity. This was already possible in Treafik, so it was simply adding responseHeaders to the code where (request) headers appeared.The blueprint code is also updated to still be backwards compatible.
headersinpangolin.ymlworks as alias forrequestHeaders. BothrequestHeadersandresponseHeadersare now accepted and if bothheadersandrequestHeadersare specified, they are merged.I also let Claude do the translations, I am unsure if they are correct. But the languages I speak are good.
I created a PR before, without reading the CONTRIBUTING.md (very sorry about that). In that PR wrote some migrations, so when you need to make them you can copy them. There are also some remarks from copilot which I fixed. #3171
How to test?
customRequestHeadersandcustomResponseHeaderscurl -vthrough Traefik confirms response headers appear on the HTTP response and request headers arrive at the upstream targetheadersset in a blueprint continue to work after migration