Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NotExists to HeaderMatchMode enum #1697

Closed
mak0t0san opened this issue May 6, 2022 · 4 comments · Fixed by #2059
Closed

Add NotExists to HeaderMatchMode enum #1697

mak0t0san opened this issue May 6, 2022 · 4 comments · Fixed by #2059
Labels
help wanted We will welcome a contribution Type: Documentation Improvements or additions to documentation
Milestone

Comments

@mak0t0san
Copy link

mak0t0san commented May 6, 2022

What should we add or change to make your life better?

Would like the ability to match only when a particular header is not present. This could be done by adding a NotExists value to HeaderMatchMode and implement code to handle it.

Why is this important to you?

In my particular scenario we have an API application that runs in multiple types of environments, such as containerized environments as well as a dedicate virtual machine. There are a couple of endpoints that don't work in the containerized environment so we use YARP to reverse-proxy those requests to the VM environment. We've also had to add some extra deployment steps so that we can set different configuration values for the containerized version and the VM version. I would like to avoid having to setup extra deployment steps by having YARP add a header so that servers downstream can know that it's being forwarded the request. Simply checking for the presence of a X-Forwarded* header is not sufficient as the servers upstream are behind load balancers that already get this header.

Here's what I want to do:

  • Load-Balancer gets request, forwards to containerized environment
  • Containerized environment receives request. YARP configuration will reverse proxy some endpoints if a custom header does NOT exist and will transform and add a custom header
  • VM environment receives request from YARP with new custom header added. This has the same exact files, including YARP configuration as the upstream servers. However, the YARP rule will only match if the new header does NOT exist but the upstream server added the header so the YARP rule won't match and the code in the app will handle the request.
@mak0t0san mak0t0san added the Type: Idea This issue is a high-level idea for discussion. label May 6, 2022
@karelz karelz added this to the Backlog milestone May 17, 2022
@karelz
Copy link
Member

karelz commented May 17, 2022

Triage: Not high demand so far (please upvote top post if you want it) - moving to Backlog for now.
It should be fairly straightforward and we would take a contribution.

@kevbry
Copy link
Contributor

kevbry commented Jul 15, 2022

@karelz I needed this as well - PR submitted.

@MihaZupan MihaZupan modified the milestones: Backlog, YARP 2.0.0 Jul 25, 2022
@MihaZupan
Copy link
Member

Added in #1806

@MihaZupan MihaZupan reopened this Jul 26, 2022
@MihaZupan
Copy link
Member

Reopening to track adding docs

@MihaZupan MihaZupan added Type: Documentation Improvements or additions to documentation and removed Type: Idea This issue is a high-level idea for discussion. labels Jul 26, 2022
@karelz karelz modified the milestones: YARP 2.0.0, Backlog Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We will welcome a contribution Type: Documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants